<?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=Nhl13</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=Nhl13"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Nhl13"/>
	<updated>2026-05-16T12:11:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_1_million_solid_.png&amp;diff=543334</id>
		<title>File:Integral of VACF of 1 million solid .png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_1_million_solid_.png&amp;diff=543334"/>
		<updated>2016-02-26T00:16:17Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: Nhl13 uploaded a new version of File:Integral of VACF of 1 million solid .png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_1_million_liquid.png&amp;diff=543333</id>
		<title>File:Integral of VACF of 1 million liquid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_1_million_liquid.png&amp;diff=543333"/>
		<updated>2016-02-26T00:15:51Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: Nhl13 uploaded a new version of File:Integral of VACF of 1 million liquid.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_1_million_gas.png&amp;diff=543332</id>
		<title>File:Integral of VACF of 1 million gas.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_1_million_gas.png&amp;diff=543332"/>
		<updated>2016-02-26T00:15:27Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: Nhl13 uploaded a new version of File:Integral of VACF of 1 million gas.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_solid.png&amp;diff=543331</id>
		<title>File:Integral of VACF of solid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_solid.png&amp;diff=543331"/>
		<updated>2016-02-26T00:15:06Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: Nhl13 uploaded a new version of File:Integral of VACF of solid.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_liquid.png&amp;diff=543330</id>
		<title>File:Integral of VACF of liquid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_liquid.png&amp;diff=543330"/>
		<updated>2016-02-26T00:14:43Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: Nhl13 uploaded a new version of File:Integral of VACF of liquid.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_gas.png&amp;diff=543329</id>
		<title>File:Integral of VACF of gas.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_gas.png&amp;diff=543329"/>
		<updated>2016-02-26T00:14:23Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: Nhl13 uploaded a new version of File:Integral of VACF of gas.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543326</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543326"/>
		<updated>2016-02-26T00:09:12Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy (figure 6), temperature (figure 7) and pressure (figure 8) reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. Figure 9 showed the total energy fluctuation against time simulated at different timestep. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This timestep was not suitable  for simulation. When timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. On the other hand, timestep cannot be too short, as it lowers the efficiency of the simulation. As a result, the most acceptable timestep for our simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were within the range of the pressure equilibrium calculated in the last simulation. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three number in the command corresponded to Nevery, Nrepeat and Nfreq respectively. Nevery tells how often are the input values to be used for calculation, Nrepeat tells the number of times of each set of input values is used to calculate the average, and Nfreq tells the number of timestep for calculating an average. In our case, i.e. 100 1000 100000, the input values are used every 100 timesteps, the average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. As timestep of 0.0025 s was used, our simulation time would be 100000 x 0.0025 = 250 s&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature, while increases with pressure. These phenomenons could be rationalised easily. As temperature increases, molecules have higher kinetic energy to overcome the attractive interaction between them, and move apart easier, thus resulting a lower density. On the other hand, when pressure increases, molecules experience a greater compression force and are packed closer together, thus resulting a higher density.  Figure 10 also showed that the error in density was much smaller than the error in temperature. On the other hand, the simulated density was much lower than the density calculated from the ideal gas law. It was because the ideal gas law assume there were no repulsive forces between molecules, while the simulation by LAMMPS was able to mimic the repulsive forces between molecules. As consequence, the simulated density was lower as repulsive force between molecules pushed each other away. Moreover, the discrepancy between simulated and calculated density increased when pressure increased. It was because gas would behave more as a real gas rather than ideal gas under higher pressure, hence, the discrepancy increased as ideal gas was no longer relevant to the situation.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|Fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table showed the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radial distance to a reference atom. Each peak in RDF indicates a particularly favoured separation distance of a neighbouring atom to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks for liquid, and just one large broad peak for gas. It revealed atoms in solid were highly ordered and stayed at particular distance to the reference atom. Sharp peaks also indicated the atoms were not spread out randomly but were concentrated at several favoured particular distances. Moreover, the coordination number at favoured particular distances could be determined from the integral of RDF. In contrast, a few peaks in liquid RDF revealed its system was less ordered and atoms were able to move around freely and rarely stay at a particular distance to the reference atom. However, peaks still showed up illustrated that the atoms were still held together by some sort of attraction forces. On the other hand, broad peaks were observed in RDF of liquid and gas, while peak for gas was broader than those for liquid. This could be rationalised by the Brownian motion of the atoms in the system. The atoms in gas had higher kinetic energy, therefore, they could move faster and more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicated the gas atoms were still holding with each other at a maximum interacting distance. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild appeared at 1.025, 1.475 and 1.825. These corresponded to the first three sets of nearest coordinating neighbours to a reference atom. The simulation shown the lattice spacing, a, was 1.47361, and by visualising the fcc lattice model, we knew the nearest neighbour had a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour had a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour had a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. When we combined all informations, the lattice spacing between the reference atom and the nearest neighbours could then be calculated by Pythagoras theorem. The results were summarised in the table below.It was found that the peaks in RDF were similar and comparable to the calculated results. On the other hand, the integral of RDF, which was accumulative, showed the coordination number of the neighbouring atoms. This also agreed with the theoretical fcc model. See figure 14 and 15. To conclude, both peak and integral of RDF gave evidence that RDF could be used to determine lattice structure. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number!! Integral of RDF&lt;br /&gt;
|-&lt;br /&gt;
| First || 1.025 || 1.042 || 12 || 11.9&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;12&lt;br /&gt;
|-&lt;br /&gt;
| Second || 1.475 || 1.474 || 6 || 17.8-11.9&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;6&lt;br /&gt;
|-&lt;br /&gt;
| Third || 1.825 || 1. 805|| 24 || 41.8-17.8&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6}\times gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23.1&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. We also know an odd function multiplies an even function gives an odd function, and the integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23.2&amp;lt;/big&amp;gt;: 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;
Figure 19 compared the VACF of a solid and a liquid simulation to the normalised classic harmonic oscillator. The solid simulation showed a minima at timestep = 47, while liquid simulation did not give a obvious minima, its function fluctuated about 0 after timestep = 109. Minima was observed because there were atom collisions in the solid and liquid simulations, and caused a change in velocity direction. Moreover, collisions in Lennard-Jones system led to loss of velocity and loss of energy, hence, the VACF was no longer correlated to time at very long time and remained at 0.  In contrast, the VACF of harmonic oscillator gave a periodic function because there was no atom collision within the system. Therefore, no lost of energy and the oscillator would oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Diffusion coefficient could be calculated from equation: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence, &amp;lt;math&amp;gt;D*=\frac{1}{3} \times integral&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D=D* \times 0.002&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]The results were compared with the D calculated from MSD and were showed in the table below.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]The diffusion coefficient, D, obtained from MSD and VACF were not quite the same, however, they did have comparable value in term of the magnitude. D of solid was almost zero for both calculations. D calculated from VACF was 100 times larger than that from MSD. In contrast, two calculated D values for liquid were similar and were comparable, even for both 1 atom simulation and 1 million atom simulation. The D value obtained for 1 million atom simulation were similar to those for 1 atom simulation. The largest source of error for estimate D from VACF was that it was only an approximation of the integral. &lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543323</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543323"/>
		<updated>2016-02-25T23:58:51Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy (figure 6), temperature (figure 7) and pressure (figure 8) reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. Figure 9 showed the total energy fluctuation against time simulated at different timestep. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This timestep was not suitable  for simulation. When timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. On the other hand, timestep cannot be too short, as it lowers the efficiency of the simulation. As a result, the most acceptable timestep for our simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were within the range of the pressure equilibrium calculated in the last simulation. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three number in the command corresponded to Nevery, Nrepeat and Nfreq respectively. Nevery tells how often are the input values to be used for calculation, Nrepeat tells the number of times of each set of input values is used to calculate the average, and Nfreq tells the number of timestep for calculating an average. In our case, i.e. 100 1000 100000, the input values are used every 100 timesteps, the average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. As timestep of 0.0025 s was used, our simulation time would be 100000 x 0.0025 = 250 s&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature, while increases with pressure. These phenomenons could be rationalised easily. As temperature increases, molecules have higher kinetic energy to overcome the attractive interaction between them, and move apart easier, thus resulting a lower density. On the other hand, when pressure increases, molecules experience a greater compression force and are packed closer together, thus resulting a higher density.  Figure 10 also showed that the error in density was much smaller than the error in temperature. On the other hand, the simulated density was much lower than the density calculated from the ideal gas law. It was because the ideal gas law assume there were no repulsive forces between molecules, while the simulation by LAMMPS was able to mimic the repulsive forces between molecules. As consequence, the simulated density was lower as repulsive force between molecules pushed each other away. Moreover, the discrepancy between simulated and calculated density increased when pressure increased. It was because gas would behave more as a real gas rather than ideal gas under higher pressure, hence, the discrepancy increased as ideal gas was no longer relevant to the situation.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|Fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table showed the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radial distance to a reference atom. Each peak in RDF indicates a particularly favoured separation distance of a neighbouring atom to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks for liquid, and just one large broad peak for gas. It revealed atoms in solid were highly ordered and stayed at particular distance to the reference atom. Sharp peaks also indicated the atoms were not spread out randomly but were concentrated at several favoured particular distances. Moreover, the coordination number at favoured particular distances could be determined from the integral of RDF. In contrast, a few peaks in liquid RDF revealed its system was less ordered and atoms were able to move around freely and rarely stay at a particular distance to the reference atom. However, peaks still showed up illustrated that the atoms were still held together by some sort of attraction forces. On the other hand, broad peaks were observed in RDF of liquid and gas, while peak for gas was broader than those for liquid. This could be rationalised by the Brownian motion of the atoms in the system. The atoms in gas had higher kinetic energy, therefore, they could move faster and more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicated the gas atoms were still holding with each other at a maximum interacting distance. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild appeared at 1.025, 1.475 and 1.825. These corresponded to the first three sets of nearest coordinating neighbours to a reference atom. The simulation shown the lattice spacing, a, was 1.47361, and by visualising the fcc lattice model, we knew the nearest neighbour had a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour had a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour had a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. When we combined all informations, the lattice spacing between the reference atom and the nearest neighbours could then be calculated by Pythagoras theorem. The results were summarised in the table below.It was found that the peaks in RDF were similar and comparable to the calculated results. On the other hand, the integral of RDF, which was accumulative, showed the coordination number of the neighbouring atoms. This also agreed with the theoretical fcc model. See figure 14 and 15. To conclude, both peak and integral of RDF gave evidence that RDF could be used to determine lattice structure. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number!! Integral of RDF&lt;br /&gt;
|-&lt;br /&gt;
| First || 1.025 || 1.042 || 12 || 11.9&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;12&lt;br /&gt;
|-&lt;br /&gt;
| Second || 1.475 || 1.474 || 6 || 17.8-11.9&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;6&lt;br /&gt;
|-&lt;br /&gt;
| Third || 1.825 || 1. 805|| 24 || 41.8-17.8&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6}\times gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23.1&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. We also know an odd function multiplies an even function gives an odd function, and the integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23.2&amp;lt;/big&amp;gt;: 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;
Figure 19 compared the VACF of a solid and a liquid simulation to the normalised classic harmonic oscillator. The solid simulation showed a minima at timestep = 47, while liquid simulation did not give a obvious minima, its function fluctuated about 0 after timestep = 109. Minima was observed because there were atom collisions in the solid and liquid simulations, and caused a change in velocity direction. Moreover, collisions in Lennard-Jones system led to loss of velocity and loss of energy, hence, the VACF was no longer correlated to time at very long time and remained at 0.  In contrast, the VACF of harmonic oscillator gave a periodic function because there was no atom collision within the system. Therefore, no lost of energy and the oscillator would oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Diffusion coefficient could be calculated from equation: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence, &amp;lt;math&amp;gt;D*=\frac{1}{3} \times integral&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D=D* \times 0.002&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543311</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543311"/>
		<updated>2016-02-25T23:47:49Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy (figure 6), temperature (figure 7) and pressure (figure 8) reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. Figure 9 showed the total energy fluctuation against time simulated at different timestep. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This timestep was not suitable  for simulation. When timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. On the other hand, timestep cannot be too short, as it lowers the efficiency of the simulation. As a result, the most acceptable timestep for our simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were within the range of the pressure equilibrium calculated in the last simulation. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three number in the command corresponded to Nevery, Nrepeat and Nfreq respectively. Nevery tells how often are the input values to be used for calculation, Nrepeat tells the number of times of each set of input values is used to calculate the average, and Nfreq tells the number of timestep for calculating an average. In our case, i.e. 100 1000 100000, the input values are used every 100 timesteps, the average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. As timestep of 0.0025 s was used, our simulation time would be 100000 x 0.0025 = 250 s&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature, while increases with pressure. These phenomenons could be rationalised easily. As temperature increases, molecules have higher kinetic energy to overcome the attractive interaction between them, and move apart easier, thus resulting a lower density. On the other hand, when pressure increases, molecules experience a greater compression force and are packed closer together, thus resulting a higher density.  Figure 10 also showed that the error in density was much smaller than the error in temperature. On the other hand, the simulated density was much lower than the density calculated from the ideal gas law. It was because the ideal gas law assume there were no repulsive forces between molecules, while the simulation by LAMMPS was able to mimic the repulsive forces between molecules. As consequence, the simulated density was lower as repulsive force between molecules pushed each other away. Moreover, the discrepancy between simulated and calculated density increased when pressure increased. It was because gas would behave more as a real gas rather than ideal gas under higher pressure, hence, the discrepancy increased as ideal gas was no longer relevant to the situation.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|Fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table showed the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radial distance to a reference atom. Each peak in RDF indicates a particularly favoured separation distance of a neighbouring atom to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks for liquid, and just one large broad peak for gas. It revealed atoms in solid were highly ordered and stayed at particular distance to the reference atom. Sharp peaks also indicated the atoms were not spread out randomly but were concentrated at several favoured particular distances. Moreover, the coordination number at favoured particular distances could be determined from the integral of RDF. In contrast, a few peaks in liquid RDF revealed its system was less ordered and atoms were able to move around freely and rarely stay at a particular distance to the reference atom. However, peaks still showed up illustrated that the atoms were still held together by some sort of attraction forces. On the other hand, broad peaks were observed in RDF of liquid and gas, while peak for gas was broader than those for liquid. This could be rationalised by the Brownian motion of the atoms in the system. The atoms in gas had higher kinetic energy, therefore, they could move faster and more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicated the gas atoms were still holding with each other at a maximum interacting distance. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild appeared at 1.025, 1.475 and 1.825. These corresponded to the first three sets of nearest coordinating neighbours to a reference atom. The simulation shown the lattice spacing, a, was 1.47361, and by visualising the fcc lattice model, we knew the nearest neighbour had a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour had a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour had a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. When we combined all informations, the lattice spacing between the reference atom and the nearest neighbours could then be calculated by Pythagoras theorem. The results were summarised in the table below.It was found that the peaks in RDF were similar and comparable to the calculated results. On the other hand, the integral of RDF, which was accumulative, showed the coordination number of the neighbouring atoms. This also agreed with the theoretical fcc model. See figure 14 and 15. To conclude, both peak and integral of RDF gave evidence that RDF could be used to determine lattice structure. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number!! Integral of RDF&lt;br /&gt;
|-&lt;br /&gt;
| First || 1.025 || 1.042 || 12 || 11.9&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;12&lt;br /&gt;
|-&lt;br /&gt;
| Second || 1.475 || 1.474 || 6 || 17.8-11.9&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;6&lt;br /&gt;
|-&lt;br /&gt;
| Third || 1.825 || 1. 805|| 24 || 41.8-17.8&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6}\times gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543308</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543308"/>
		<updated>2016-02-25T23:46:54Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy (figure 6), temperature (figure 7) and pressure (figure 8) reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. Figure 9 showed the total energy fluctuation against time simulated at different timestep. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This timestep was not suitable  for simulation. When timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. On the other hand, timestep cannot be too short, as it lowers the efficiency of the simulation. As a result, the most acceptable timestep for our simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were within the range of the pressure equilibrium calculated in the last simulation. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three number in the command corresponded to Nevery, Nrepeat and Nfreq respectively. Nevery tells how often are the input values to be used for calculation, Nrepeat tells the number of times of each set of input values is used to calculate the average, and Nfreq tells the number of timestep for calculating an average. In our case, i.e. 100 1000 100000, the input values are used every 100 timesteps, the average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. As timestep of 0.0025 s was used, our simulation time would be 100000 x 0.0025 = 250 s&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature, while increases with pressure. These phenomenons could be rationalised easily. As temperature increases, molecules have higher kinetic energy to overcome the attractive interaction between them, and move apart easier, thus resulting a lower density. On the other hand, when pressure increases, molecules experience a greater compression force and are packed closer together, thus resulting a higher density.  Figure 10 also showed that the error in density was much smaller than the error in temperature. On the other hand, the simulated density was much lower than the density calculated from the ideal gas law. It was because the ideal gas law assume there were no repulsive forces between molecules, while the simulation by LAMMPS was able to mimic the repulsive forces between molecules. As consequence, the simulated density was lower as repulsive force between molecules pushed each other away. Moreover, the discrepancy between simulated and calculated density increased when pressure increased. It was because gas would behave more as a real gas rather than ideal gas under higher pressure, hence, the discrepancy increased as ideal gas was no longer relevant to the situation.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|Fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table showed the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radial distance to a reference atom. Each peak in RDF indicates a particularly favoured separation distance of a neighbouring atom to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks for liquid, and just one large broad peak for gas. It revealed atoms in solid were highly ordered and stayed at particular distance to the reference atom. Sharp peaks also indicated the atoms were not spread out randomly but were concentrated at several favoured particular distances. Moreover, the coordination number at favoured particular distances could be determined from the integral of RDF. In contrast, a few peaks in liquid RDF revealed its system was less ordered and atoms were able to move around freely and rarely stay at a particular distance to the reference atom. However, peaks still showed up illustrated that the atoms were still held together by some sort of attraction forces. On the other hand, broad peaks were observed in RDF of liquid and gas, while peak for gas was broader than those for liquid. This could be rationalised by the Brownian motion of the atoms in the system. The atoms in gas had higher kinetic energy, therefore, they could move faster and more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicated the gas atoms were still holding with each other at a maximum interacting distance. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild appeared at 1.025, 1.475 and 1.825. These corresponded to the first three sets of nearest coordinating neighbours to a reference atom. The simulation shown the lattice spacing, a, was 1.47361, and by visualising the fcc lattice model, we knew the nearest neighbour had a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour had a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour had a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. When we combined all informations, the lattice spacing between the reference atom and the nearest neighbours could then be calculated by Pythagoras theorem. The results were summarised in the table below.It was found that the peaks in RDF were similar and comparable to the calculated results. On the other hand, the integral of RDF, which was accumulative, showed the coordination number of the neighbouring atoms. This also agreed with the theoretical fcc model. See figure 14 and 15. To conclude, both peak and integral of RDF gave evidence that RDF could be used to determine lattice structure. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number!! Integral of RDF&lt;br /&gt;
|-&lt;br /&gt;
| First || 1.025 || 1.042 || 12 || 11.9&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;12&lt;br /&gt;
|-&lt;br /&gt;
| Second || 1.475 || 1.474 || 6 || 17.8-11.9&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;6&lt;br /&gt;
|-&lt;br /&gt;
| Third || 1.825 || 1. 805|| 24 || 41.8-17.8&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543304</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543304"/>
		<updated>2016-02-25T23:42:58Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy (figure 6), temperature (figure 7) and pressure (figure 8) reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. Figure 9 showed the total energy fluctuation against time simulated at different timestep. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This timestep was not suitable  for simulation. When timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. On the other hand, timestep cannot be too short, as it lowers the efficiency of the simulation. As a result, the most acceptable timestep for our simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were within the range of the pressure equilibrium calculated in the last simulation. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three number in the command corresponded to Nevery, Nrepeat and Nfreq respectively. Nevery tells how often are the input values to be used for calculation, Nrepeat tells the number of times of each set of input values is used to calculate the average, and Nfreq tells the number of timestep for calculating an average. In our case, i.e. 100 1000 100000, the input values are used every 100 timesteps, the average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. As timestep of 0.0025 s was used, our simulation time would be 100000 x 0.0025 = 250 s&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature, while increases with pressure. These phenomenons could be rationalised easily. As temperature increases, molecules have higher kinetic energy to overcome the attractive interaction between them, and move apart easier, thus resulting a lower density. On the other hand, when pressure increases, molecules experience a greater compression force and are packed closer together, thus resulting a higher density.  Figure 10 also showed that the error in density was much smaller than the error in temperature. On the other hand, the simulated density was much lower than the density calculated from the ideal gas law. It was because the ideal gas law assume there were no repulsive forces between molecules, while the simulation by LAMMPS was able to mimic the repulsive forces between molecules. As consequence, the simulated density was lower as repulsive force between molecules pushed each other away. Moreover, the discrepancy between simulated and calculated density increased when pressure increased. It was because gas would behave more as a real gas rather than ideal gas under higher pressure, hence, the discrepancy increased as ideal gas was no longer relevant to the situation.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|Fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table showed the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radial distance to a reference atom. Each peak in RDF indicates a particularly favoured separation distance of a neighbouring atom to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks for liquid, and just one large broad peak for gas. It revealed atoms in solid were highly ordered and stayed at particular distance to the reference atom. Sharp peaks also indicated the atoms were not spread out randomly but were concentrated at several favoured particular distances. Moreover, the coordination number at favoured particular distances could be determined from the integral of RDF. In contrast, a few peaks in liquid RDF revealed its system was less ordered and atoms were able to move around freely and rarely stay at a particular distance to the reference atom. However, peaks still showed up illustrated that the atoms were still held together by some sort of attraction forces. On the other hand, broad peaks were observed in RDF of liquid and gas, while peak for gas was broader than those for liquid. This could be rationalised by the Brownian motion of the atoms in the system. The atoms in gas had higher kinetic energy, therefore, they could move faster and more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicated the gas atoms were still holding with each other at a maximum interacting distance. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild appeared at 1.025, 1.475 and 1.825. These corresponded to the first three sets of nearest coordinating neighbours to a reference atom. The simulation shown the lattice spacing, a, was 1.47361, and by visualising the fcc lattice model, we knew the nearest neighbour had a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour had a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour had a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. When we combined all informations, the lattice spacing between the reference atom and the nearest neighbours could then be calculated by Pythagoras theorem. The results were summarised in the table below.It was found that the peaks in RDF were similar and comparable to the calculated results. On the other hand, the integral of RDF, which was accumulative, showed the coordination number of the neighbouring atoms. This also agreed with the theoretical fcc model. See figure 14 and 15. To conclude, both peak and integral of RDF gave evidence that RDF could be used to determine lattice structure. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number!! Integral of RDF&lt;br /&gt;
|-&lt;br /&gt;
| First || 1.025 || 1.042 || 12 || 11.9&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;12&lt;br /&gt;
|-&lt;br /&gt;
| Second || 1.475 || 1.474 || 6 || 17.8-11.9&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;6&lt;br /&gt;
|-&lt;br /&gt;
| Third || 1.825 || 1. 805|| 24 || 41.8-17.8&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543302</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543302"/>
		<updated>2016-02-25T23:42:20Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy (figure 6), temperature (figure 7) and pressure (figure 8) reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. Figure 9 showed the total energy fluctuation against time simulated at different timestep. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This timestep was not suitable  for simulation. When timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. On the other hand, timestep cannot be too short, as it lowers the efficiency of the simulation. As a result, the most acceptable timestep for our simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were within the range of the pressure equilibrium calculated in the last simulation. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three number in the command corresponded to Nevery, Nrepeat and Nfreq respectively. Nevery tells how often are the input values to be used for calculation, Nrepeat tells the number of times of each set of input values is used to calculate the average, and Nfreq tells the number of timestep for calculating an average. In our case, i.e. 100 1000 100000, the input values are used every 100 timesteps, the average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. As timestep of 0.0025 s was used, our simulation time would be 100000 x 0.0025 = 250 s&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature, while increases with pressure. These phenomenons could be rationalised easily. As temperature increases, molecules have higher kinetic energy to overcome the attractive interaction between them, and move apart easier, thus resulting a lower density. On the other hand, when pressure increases, molecules experience a greater compression force and are packed closer together, thus resulting a higher density.  Figure 10 also showed that the error in density was much smaller than the error in temperature. On the other hand, the simulated density was much lower than the density calculated from the ideal gas law. It was because the ideal gas law assume there were no repulsive forces between molecules, while the simulation by LAMMPS was able to mimic the repulsive forces between molecules. As consequence, the simulated density was lower as repulsive force between molecules pushed each other away. Moreover, the discrepancy between simulated and calculated density increased when pressure increased. It was because gas would behave more as a real gas rather than ideal gas under higher pressure, hence, the discrepancy increased as ideal gas was no longer relevant to the situation.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|Fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table showed the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radial distance to a reference atom. Each peak in RDF indicates a particularly favoured separation distance of a neighbouring atom to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks for liquid, and just one large broad peak for gas. It revealed atoms in solid were highly ordered and stayed at particular distance to the reference atom. Sharp peaks also indicated the atoms were not spread out randomly but were concentrated at several favoured particular distances. Moreover, the coordination number at favoured particular distances could be determined from the integral of RDF. In contrast, a few peaks in liquid RDF revealed its system was less ordered and atoms were able to move around freely and rarely stay at a particular distance to the reference atom. However, peaks still showed up illustrated that the atoms were still held together by some sort of attraction forces. On the other hand, broad peaks were observed in RDF of liquid and gas, while peak for gas was broader than those for liquid. This could be rationalised by the Brownian motion of the atoms in the system. The atoms in gas had higher kinetic energy, therefore, they could move faster and more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicated the gas atoms were still holding with each other at a maximum interacting distance. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild appeared at 1.025, 1.475 and 1.825. These corresponded to the first three sets of nearest coordinating neighbours to a reference atom. The simulation shown the lattice spacing, a, was 1.47361, and by visualising the fcc lattice model, we knew the nearest neighbour had a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour had a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour had a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. When we combined all informations, the lattice spacing between the reference atom and the nearest neighbours could then be calculated by Pythagoras theorem. The results were summarised in the table below.It was found that the peaks in RDF were similar and comparable to the calculated results. On the other hand, the integral of RDF, which was accumulative, showed the coordination number of the neighbouring atoms. This also agreed with the theoretical fcc model. See figure 14 and 15. To conclude, both peak and integral of RDF gave evidence that RDF could be used to determine lattice structure. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number!!&lt;br /&gt;
|-&lt;br /&gt;
| First || 1.025 || 1.042 || 12 || 11.9&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;12&lt;br /&gt;
|-&lt;br /&gt;
| Second || 1.475 || 1.474 || 6 || 17.8-11.9&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;6&lt;br /&gt;
|-&lt;br /&gt;
| Third || 1.825 || 1. 805|| 24 || 41.8-17.8&amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt;24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543299</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543299"/>
		<updated>2016-02-25T23:41:46Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy (figure 6), temperature (figure 7) and pressure (figure 8) reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. Figure 9 showed the total energy fluctuation against time simulated at different timestep. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This timestep was not suitable  for simulation. When timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. On the other hand, timestep cannot be too short, as it lowers the efficiency of the simulation. As a result, the most acceptable timestep for our simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were within the range of the pressure equilibrium calculated in the last simulation. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three number in the command corresponded to Nevery, Nrepeat and Nfreq respectively. Nevery tells how often are the input values to be used for calculation, Nrepeat tells the number of times of each set of input values is used to calculate the average, and Nfreq tells the number of timestep for calculating an average. In our case, i.e. 100 1000 100000, the input values are used every 100 timesteps, the average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. As timestep of 0.0025 s was used, our simulation time would be 100000 x 0.0025 = 250 s&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature, while increases with pressure. These phenomenons could be rationalised easily. As temperature increases, molecules have higher kinetic energy to overcome the attractive interaction between them, and move apart easier, thus resulting a lower density. On the other hand, when pressure increases, molecules experience a greater compression force and are packed closer together, thus resulting a higher density.  Figure 10 also showed that the error in density was much smaller than the error in temperature. On the other hand, the simulated density was much lower than the density calculated from the ideal gas law. It was because the ideal gas law assume there were no repulsive forces between molecules, while the simulation by LAMMPS was able to mimic the repulsive forces between molecules. As consequence, the simulated density was lower as repulsive force between molecules pushed each other away. Moreover, the discrepancy between simulated and calculated density increased when pressure increased. It was because gas would behave more as a real gas rather than ideal gas under higher pressure, hence, the discrepancy increased as ideal gas was no longer relevant to the situation.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|Fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table showed the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radial distance to a reference atom. Each peak in RDF indicates a particularly favoured separation distance of a neighbouring atom to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks for liquid, and just one large broad peak for gas. It revealed atoms in solid were highly ordered and stayed at particular distance to the reference atom. Sharp peaks also indicated the atoms were not spread out randomly but were concentrated at several favoured particular distances. Moreover, the coordination number at favoured particular distances could be determined from the integral of RDF. In contrast, a few peaks in liquid RDF revealed its system was less ordered and atoms were able to move around freely and rarely stay at a particular distance to the reference atom. However, peaks still showed up illustrated that the atoms were still held together by some sort of attraction forces. On the other hand, broad peaks were observed in RDF of liquid and gas, while peak for gas was broader than those for liquid. This could be rationalised by the Brownian motion of the atoms in the system. The atoms in gas had higher kinetic energy, therefore, they could move faster and more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicated the gas atoms were still holding with each other at a maximum interacting distance. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild appeared at 1.025, 1.475 and 1.825. These corresponded to the first three sets of nearest coordinating neighbours to a reference atom. The simulation shown the lattice spacing, a, was 1.47361, and by visualising the fcc lattice model, we knew the nearest neighbour had a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour had a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour had a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. When we combined all informations, the lattice spacing between the reference atom and the nearest neighbours could then be calculated by Pythagoras theorem. The results were summarised in the table below.It was found that the peaks in RDF were similar and comparable to the calculated results. On the other hand, the integral of RDF, which was accumulative, showed the coordination number of the neighbouring atoms. This also agreed with the theoretical fcc model. See figure 14 and 15. To conclude, both peak and integral of RDF gave evidence that RDF could be used to determine lattice structure. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number!!&lt;br /&gt;
|-&lt;br /&gt;
| First || 1.025 || 1.042 || 12 || 11.9\approx \12&lt;br /&gt;
|-&lt;br /&gt;
| Second || 1.475 || 1.474 || 6 || 17.8-11.9\approx\6&lt;br /&gt;
|-&lt;br /&gt;
| Third || 1.825 || 1. 805|| 24 || 41.8-17.8\approx\24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543298</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543298"/>
		<updated>2016-02-25T23:41:00Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy (figure 6), temperature (figure 7) and pressure (figure 8) reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. Figure 9 showed the total energy fluctuation against time simulated at different timestep. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This timestep was not suitable  for simulation. When timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. On the other hand, timestep cannot be too short, as it lowers the efficiency of the simulation. As a result, the most acceptable timestep for our simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were within the range of the pressure equilibrium calculated in the last simulation. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three number in the command corresponded to Nevery, Nrepeat and Nfreq respectively. Nevery tells how often are the input values to be used for calculation, Nrepeat tells the number of times of each set of input values is used to calculate the average, and Nfreq tells the number of timestep for calculating an average. In our case, i.e. 100 1000 100000, the input values are used every 100 timesteps, the average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. As timestep of 0.0025 s was used, our simulation time would be 100000 x 0.0025 = 250 s&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature, while increases with pressure. These phenomenons could be rationalised easily. As temperature increases, molecules have higher kinetic energy to overcome the attractive interaction between them, and move apart easier, thus resulting a lower density. On the other hand, when pressure increases, molecules experience a greater compression force and are packed closer together, thus resulting a higher density.  Figure 10 also showed that the error in density was much smaller than the error in temperature. On the other hand, the simulated density was much lower than the density calculated from the ideal gas law. It was because the ideal gas law assume there were no repulsive forces between molecules, while the simulation by LAMMPS was able to mimic the repulsive forces between molecules. As consequence, the simulated density was lower as repulsive force between molecules pushed each other away. Moreover, the discrepancy between simulated and calculated density increased when pressure increased. It was because gas would behave more as a real gas rather than ideal gas under higher pressure, hence, the discrepancy increased as ideal gas was no longer relevant to the situation.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|Fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table showed the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radial distance to a reference atom. Each peak in RDF indicates a particularly favoured separation distance of a neighbouring atom to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks for liquid, and just one large broad peak for gas. It revealed atoms in solid were highly ordered and stayed at particular distance to the reference atom. Sharp peaks also indicated the atoms were not spread out randomly but were concentrated at several favoured particular distances. Moreover, the coordination number at favoured particular distances could be determined from the integral of RDF. In contrast, a few peaks in liquid RDF revealed its system was less ordered and atoms were able to move around freely and rarely stay at a particular distance to the reference atom. However, peaks still showed up illustrated that the atoms were still held together by some sort of attraction forces. On the other hand, broad peaks were observed in RDF of liquid and gas, while peak for gas was broader than those for liquid. This could be rationalised by the Brownian motion of the atoms in the system. The atoms in gas had higher kinetic energy, therefore, they could move faster and more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicated the gas atoms were still holding with each other at a maximum interacting distance. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild appeared at 1.025, 1.475 and 1.825. These corresponded to the first three sets of nearest coordinating neighbours to a reference atom. The simulation shown the lattice spacing, a, was 1.47361, and by visualising the fcc lattice model, we knew the nearest neighbour had a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour had a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour had a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. When we combined all informations, the lattice spacing between the reference atom and the nearest neighbours could then be calculated by Pythagoras theorem. The results were summarised in the table below.It was found that the peaks in RDF were similar and comparable to the calculated results. On the other hand, the integral of RDF, which was accumulative, showed the coordination number of the neighbouring atoms. This also agreed with the theoretical fcc model. See figure 14 and 15. To conclude, both peak and integral of RDF gave evidence that RDF could be used to determine lattice structure. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number!!&lt;br /&gt;
|-&lt;br /&gt;
| First || 1.025 || 1.042 || 12 || 11.9\approx 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || 1.475 || 1.474 || 6 || 17.8-11.9\approx6&lt;br /&gt;
|-&lt;br /&gt;
| Third || 1.825 || 1. 805|| 24 || 41.8-17.8\approx24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543288</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543288"/>
		<updated>2016-02-25T23:35:10Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy (figure 6), temperature (figure 7) and pressure (figure 8) reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. Figure 9 showed the total energy fluctuation against time simulated at different timestep. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This timestep was not suitable  for simulation. When timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. On the other hand, timestep cannot be too short, as it lowers the efficiency of the simulation. As a result, the most acceptable timestep for our simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were within the range of the pressure equilibrium calculated in the last simulation. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three number in the command corresponded to Nevery, Nrepeat and Nfreq respectively. Nevery tells how often are the input values to be used for calculation, Nrepeat tells the number of times of each set of input values is used to calculate the average, and Nfreq tells the number of timestep for calculating an average. In our case, i.e. 100 1000 100000, the input values are used every 100 timesteps, the average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. As timestep of 0.0025 s was used, our simulation time would be 100000 x 0.0025 = 250 s&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature, while increases with pressure. These phenomenons could be rationalised easily. As temperature increases, molecules have higher kinetic energy to overcome the attractive interaction between them, and move apart easier, thus resulting a lower density. On the other hand, when pressure increases, molecules experience a greater compression force and are packed closer together, thus resulting a higher density.  Figure 10 also showed that the error in density was much smaller than the error in temperature. On the other hand, the simulated density was much lower than the density calculated from the ideal gas law. It was because the ideal gas law assume there were no repulsive forces between molecules, while the simulation by LAMMPS was able to mimic the repulsive forces between molecules. As consequence, the simulated density was lower as repulsive force between molecules pushed each other away. Moreover, the discrepancy between simulated and calculated density increased when pressure increased. It was because gas would behave more as a real gas rather than ideal gas under higher pressure, hence, the discrepancy increased as ideal gas was no longer relevant to the situation.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|Fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table showed the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radial distance to a reference atom. Each peak in RDF indicates a particularly favoured separation distance of a neighbouring atom to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks for liquid, and just one large broad peak for gas. It revealed atoms in solid were highly ordered and stayed at particular distance to the reference atom. Sharp peaks also indicated the atoms were not spread out randomly but were concentrated at several favoured particular distances. Moreover, the coordination number at favoured particular distances could be determined from the integral of RDF. In contrast, a few peaks in liquid RDF revealed its system was less ordered and atoms were able to move around freely and rarely stay at a particular distance to the reference atom. However, peaks still showed up illustrated that the atoms were still held together by some sort of attraction forces. On the other hand, broad peaks were observed in RDF of liquid and gas, while peak for gas was broader than those for liquid. This could be rationalised by the Brownian motion of the atoms in the system. The atoms in gas had higher kinetic energy, therefore, they could move faster and more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicated the gas atoms were still holding with each other at a maximum interacting distance. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild appeared at 1.025, 1.475 and 1.825. These corresponded to the first three sets of nearest coordinating neighbours to a reference atom. The simulation shown the lattice spacing, a, was 1.47361, and by visualising the fcc lattice model, we knew the nearest neighbour had a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour had a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour had a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. When we combined all informations, the lattice spacing between the reference atom and the nearest neighbours could then be calculated by Pythagoras theorem. The results were summarised in the table below.It was found that the peaks in RDF were similar and comparable to the calculated results. On the other hand, the integral of RDF, which was accumulative, showed the coordination number of the neighbouring atoms. This also agreed with the theoretical fcc model. See figure 14 and 15. To conclude, both peak and integral of RDF gave evidence that RDF could be used to determine lattice structure. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number!!&lt;br /&gt;
|-&lt;br /&gt;
| First || 1.025 || 1.042 || 12 || &lt;br /&gt;
|-&lt;br /&gt;
| Second || 1.475 || 1.474 || 6 ||&lt;br /&gt;
|-&lt;br /&gt;
| Third || 1.825 || 1. 805|| 24 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543241</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543241"/>
		<updated>2016-02-25T22:38:34Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Calculating heat capacities using statistical physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy (figure 6), temperature (figure 7) and pressure (figure 8) reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. Figure 9 showed the total energy fluctuation against time simulated at different timestep. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This timestep was not suitable  for simulation. When timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. On the other hand, timestep cannot be too short, as it lowers the efficiency of the simulation. As a result, the most acceptable timestep for our simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were within the range of the pressure equilibrium calculated in the last simulation. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three number in the command corresponded to Nevery, Nrepeat and Nfreq respectively. Nevery tells how often are the input values to be used for calculation, Nrepeat tells the number of times of each set of input values is used to calculate the average, and Nfreq tells the number of timestep for calculating an average. In our case, i.e. 100 1000 100000, the input values are used every 100 timesteps, the average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. As timestep of 0.0025 s was used, our simulation time would be 100000 x 0.0025 = 250 s&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature, while increases with pressure. These phenomenons could be rationalised easily. As temperature increases, molecules have higher kinetic energy to overcome the attractive interaction between them, and move apart easier, thus resulting a lower density. On the other hand, when pressure increases, molecules experience a greater compression force and are packed closer together, thus resulting a higher density.  Figure 10 also showed that the error in density was much smaller than the error in temperature. On the other hand, the simulated density was much lower than the density calculated from the ideal gas law. It was because the ideal gas law assume there were no repulsive forces between molecules, while the simulation by LAMMPS was able to mimic the repulsive forces between molecules. As consequence, the simulated density was lower as repulsive force between molecules pushed each other away. Moreover, the discrepancy between simulated and calculated density increased when pressure increased. It was because gas would behave more as a real gas rather than ideal gas under higher pressure, hence, the discrepancy increased as ideal gas was no longer relevant to the situation.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|Fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543239</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543239"/>
		<updated>2016-02-25T22:36:32Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Running simulations under specific conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy (figure 6), temperature (figure 7) and pressure (figure 8) reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. Figure 9 showed the total energy fluctuation against time simulated at different timestep. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This timestep was not suitable  for simulation. When timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. On the other hand, timestep cannot be too short, as it lowers the efficiency of the simulation. As a result, the most acceptable timestep for our simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were within the range of the pressure equilibrium calculated in the last simulation. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three number in the command corresponded to Nevery, Nrepeat and Nfreq respectively. Nevery tells how often are the input values to be used for calculation, Nrepeat tells the number of times of each set of input values is used to calculate the average, and Nfreq tells the number of timestep for calculating an average. In our case, i.e. 100 1000 100000, the input values are used every 100 timesteps, the average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. As timestep of 0.0025 s was used, our simulation time would be 100000 x 0.0025 = 250 s&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature, while increases with pressure. These phenomenons could be rationalised easily. As temperature increases, molecules have higher kinetic energy to overcome the attractive interaction between them, and move apart easier, thus resulting a lower density. On the other hand, when pressure increases, molecules experience a greater compression force and are packed closer together, thus resulting a higher density.  Figure 10 also showed that the error in density was much smaller than the error in temperature. On the other hand, the simulated density was much lower than the density calculated from the ideal gas law. It was because the ideal gas law assume there were no repulsive forces between molecules, while the simulation by LAMMPS was able to mimic the repulsive forces between molecules. As consequence, the simulated density was lower as repulsive force between molecules pushed each other away. Moreover, the discrepancy between simulated and calculated density increased when pressure increased. It was because gas would behave more as a real gas rather than ideal gas under higher pressure, hence, the discrepancy increased as ideal gas was no longer relevant to the situation.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543225</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543225"/>
		<updated>2016-02-25T22:17:46Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Running simulations under specific conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy (figure 6), temperature (figure 7) and pressure (figure 8) reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. Figure 9 showed the total energy fluctuation against time simulated at different timestep. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This timestep was not suitable  for simulation. When timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. On the other hand, timestep cannot be too short, as it lowers the efficiency of the simulation. As a result, the most acceptable timestep for our simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were within the range of the pressure equilibrium calculated in the last simulation. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543222</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543222"/>
		<updated>2016-02-25T22:15:32Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy (figure 6), temperature (figure 7) and pressure (figure 8) reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. Figure 9 showed the total energy fluctuation against time simulated at different timestep. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This timestep was not suitable  for simulation. When timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. On the other hand, timestep cannot be too short, as it lowers the efficiency of the simulation. As a result, the most acceptable timestep for our simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543209</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543209"/>
		<updated>2016-02-25T22:03:44Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, i.e. 1000 lattice unit cells, hence, fcc lattice will consist of 4 × 1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543208</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543208"/>
		<updated>2016-02-25T21:59:26Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS simulation, i.e. lattice spacing in x,y,z = 1.07722 1.07722 1.07722  &lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543207</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543207"/>
		<updated>2016-02-25T21:57:40Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} \times 8 + \frac{1}{2}\times 6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543205</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543205"/>
		<updated>2016-02-25T21:56:22Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to &amp;lt;math&amp;gt;\frac{1}{4}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{1}{2}&amp;lt;/math&amp;gt; atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} x 8 + \frac{1}{2}x6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543203</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543203"/>
		<updated>2016-02-25T21:54:29Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8} * 8 + \frac{1}{2}*6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543202</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543202"/>
		<updated>2016-02-25T21:53:52Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8}  8 + \frac{1}{2}6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543201</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543201"/>
		<updated>2016-02-25T21:53:28Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = &amp;lt;math&amp;gt;\frac{1}{8}  8 + \frac{1}{2}6 = 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.494 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543199</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543199"/>
		<updated>2016-02-25T21:50:19Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number density = \frac{number of atom}{volume}&amp;lt;/math&amp;gt; can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside a lattice unit cell.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8=\frac{0.8}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=1.0772 m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543197</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543197"/>
		<updated>2016-02-25T21:48:17Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = (T*)(ε) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. They are not fixed and can flow around and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them. The liquid simulation would be affected in both extremes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Position_of_error_maxima.PNG&amp;diff=543192</id>
		<title>File:Position of error maxima.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Position_of_error_maxima.PNG&amp;diff=543192"/>
		<updated>2016-02-25T21:43:06Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: Nhl13 uploaded a new version of File:Position of error maxima.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Position_of_error_maxima.PNG&amp;diff=543191</id>
		<title>File:Position of error maxima.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Position_of_error_maxima.PNG&amp;diff=543191"/>
		<updated>2016-02-25T21:42:14Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: Nhl13 uploaded a new version of File:Position of error maxima.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543190</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543190"/>
		<updated>2016-02-25T21:41:47Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Introduction to Molecular Dynamics Simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.1&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.2&amp;lt;/big&amp;gt;: What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7.3&amp;lt;/big&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;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = T* × ε ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543189</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543189"/>
		<updated>2016-02-25T21:41:02Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Introduction to Molecular Dynamics Simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T ÷ ε&lt;br /&gt;
&lt;br /&gt;
T = T* × ε ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) ÷ k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543187</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543187"/>
		<updated>2016-02-25T21:37:41Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Introduction to Molecular Dynamics Simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T / ε&lt;br /&gt;
&lt;br /&gt;
T = T* ε / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543185</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543185"/>
		<updated>2016-02-25T21:37:17Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Introduction to Molecular Dynamics Simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;math&amp;gt;\int_&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T / ε&lt;br /&gt;
&lt;br /&gt;
T = T* ε / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543184</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543184"/>
		<updated>2016-02-25T21:36:00Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Introduction to Molecular Dynamics Simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;math&amp;gt;\int_ 4\epsilon {\frac{\sigma^{12}}{r^{12}}}-\frac{\sigma^{6}{r^{6}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T / ε&lt;br /&gt;
&lt;br /&gt;
T = T* ε / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543183</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543183"/>
		<updated>2016-02-25T21:35:18Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Introduction to Molecular Dynamics Simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma=\epsilon=1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;math&amp;gt;\int 4\epsilon {\frac{\sigma^{12}}{r^{12}}}-\frac{\sigma^{6}{r^{6}}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T / ε&lt;br /&gt;
&lt;br /&gt;
T = T* ε / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543179</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543179"/>
		<updated>2016-02-25T21:32:45Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Introduction to Molecular Dynamics Simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the classical harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a classical harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
and x(t) from velocity-Verlet solution was used instead of analytical x(t).&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator was plotted in figure 2. The energy fluctuated between 0.500 and 0.49875, which was relatively small when compared to the maximum total energy, i.e. 0.25% of the total energy.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed that the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 4 showed the maxima of error in position between the classical and velocity-Verlet solution respectively was plotted against time. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x, when the line was set to intercept at origin. &lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillator was 0.500. From figure 5, the degree of fluctuation increased when time step increased. The total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When σ = ε = 1.0&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T / ε&lt;br /&gt;
&lt;br /&gt;
T = T* ε / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543161</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543161"/>
		<updated>2016-02-25T21:13:41Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Introduction to Molecular Dynamics Simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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;
where &amp;lt;math&amp;gt;A=1, \omega = 1, \phi=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator fluctuated between 0.500 and 0.498, which was relatively small when compared to the total energy itself.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The error in position between the classical and velocity-Verlet solution respectively was plotted in figure 4. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x - 0.0001.&lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillation was 0.500. From figure 5, the total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When σ = ε = 1.0&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&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;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T / ε&lt;br /&gt;
&lt;br /&gt;
T = T* ε / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543157</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543157"/>
		<updated>2016-02-25T21:00:21Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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 total energy of the harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator fluctuated between 0.500 and 0.498, which was relatively small when compared to the total energy itself.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The error in position between the classical and velocity-Verlet solution respectively was plotted in figure 4. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x - 0.0001.&lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillation was 0.500. From figure 5, the total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When σ = ε = 1.0&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&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;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T / ε&lt;br /&gt;
&lt;br /&gt;
T = T* ε / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.21 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.22 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.23 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.24 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.25 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543155</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543155"/>
		<updated>2016-02-25T20:59:58Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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 total energy of the harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator fluctuated between 0.500 and 0.498, which was relatively small when compared to the total energy itself.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The error in position between the classical and velocity-Verlet solution respectively was plotted in figure 4. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x - 0.0001.&lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillation was 0.500. From figure 5, the total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When σ = ε = 1.0&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&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;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T / ε&lt;br /&gt;
&lt;br /&gt;
T = T* ε / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.20 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.20 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.20 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.20 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.20 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543154</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543154"/>
		<updated>2016-02-25T20:59:37Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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 total energy of the harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator fluctuated between 0.500 and 0.498, which was relatively small when compared to the total energy itself.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The error in position between the classical and velocity-Verlet solution respectively was plotted in figure 4. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x - 0.0001.&lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillation was 0.500. From figure 5, the total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When σ = ε = 1.0&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&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;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T / ε&lt;br /&gt;
&lt;br /&gt;
T = T* ε / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 x 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.20 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.20 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.20 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.20 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.20 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543152</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543152"/>
		<updated>2016-02-25T20:59:13Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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 total energy of the harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator fluctuated between 0.500 and 0.498, which was relatively small when compared to the total energy itself.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The error in position between the classical and velocity-Verlet solution respectively was plotted in figure 4. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x - 0.0001.&lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillation was 0.500. From figure 5, the total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When σ = ε = 1.0&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&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;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T / ε&lt;br /&gt;
&lt;br /&gt;
T = T* ε / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 \ 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.20 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.20 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.20 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.20 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.20 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543151</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543151"/>
		<updated>2016-02-25T20:58:36Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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 total energy of the harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator fluctuated between 0.500 and 0.498, which was relatively small when compared to the total energy itself.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The error in position between the classical and velocity-Verlet solution respectively was plotted in figure 4. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x - 0.0001.&lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillation was 0.500. From figure 5, the total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When σ = ε = 1.0&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&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;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T / ε&lt;br /&gt;
&lt;br /&gt;
T = T* ε / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || &amp;lt;math&amp;gt;4.28*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.121&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;2.92&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || &amp;lt;math&amp;gt;4.39*10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt;3.00&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.20 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.20 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.20 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.20 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.20 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543150</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543150"/>
		<updated>2016-02-25T20:57:41Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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 total energy of the harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator fluctuated between 0.500 and 0.498, which was relatively small when compared to the total energy itself.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The error in position between the classical and velocity-Verlet solution respectively was plotted in figure 4. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x - 0.0001.&lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillation was 0.500. From figure 5, the total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When σ = ε = 1.0&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&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;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T / ε&lt;br /&gt;
&lt;br /&gt;
T = T* ε / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || 4.28*10^{-4} || 0.121|| 2.92&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || 4.39*10^{-4} || 0.0873 || 3.00&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.20 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.20 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.20 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.20 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.20 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543149</id>
		<title>Rep:Mod:nhl13</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:nhl13&amp;diff=543149"/>
		<updated>2016-02-25T20:57:16Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&#039;&#039;&#039;Simulation of a simple liquid&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:position against time.PNG|thumbnail|thumb|350px|right|Fig.1 Analytical position vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy against time.png|thumbnail|thumb|350px|right|Fig.2 Total Energy from velocity-Verlet solution vs. Time.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error against time.PNG|thumbnail|thumb|350px|right|Fig.3 Error vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
Analytical position of a classical harmonic oscillator was plotted in figure 1, where the analytical position was calculated by equation: &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 total energy of the harmonic oscillator for the velocity-Verlet solution was calculated by equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Total Energy = Kinetic Energy + Potential Energy&amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
For a harmonic oscillator, &amp;lt;math&amp;gt;KE=\frac{1}{2}\ mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;PE=\frac{1}{2}\ kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator fluctuated between 0.500 and 0.498, which was relatively small when compared to the total energy itself.&lt;br /&gt;
&lt;br /&gt;
The error in position between classical solution and velocity-Verlet solution was plotted in figure 3. It showed the error gradually increased with time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The error in position between the classical and velocity-Verlet solution respectively was plotted in figure 4. It gave a straight line with a positive slope that indicated the error was directly proportional to time. The corresponding function was y = 0.0004x - 0.0001.&lt;br /&gt;
&lt;br /&gt;
[[File:Position of error maxima.PNG|thumbnail|thumb|350px|right|Fig 4.Position of error maxima vs. Time.]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Different timestep.PNG|thumbnail|thumb|350px|right|Fig.5 Fluctuation in energy with different timestep.]]&lt;br /&gt;
&lt;br /&gt;
The maximum total energy of the harmonic oscillation was 0.500. From figure 5, the total energy had a fluctuation of 5x10^-3, i.e. 1% of the maximum energy, when the timestep reached 0.20 s. Hence, the timestep had to be equal or smaller than 0.20 s in order to obtain an accurate simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.1:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When potential energy &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r=r_{0}&amp;lt;/math&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;
&amp;lt;math&amp;gt; 0 = 4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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;\sigma^6= {r_{0}}^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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt;: What is the force at this separation? &lt;br /&gt;
&lt;br /&gt;
F (r) = - dU/dr&lt;br /&gt;
&lt;br /&gt;
F (r) = - d [4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = d [ - 4 ε (σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-12&amp;lt;/sup&amp;gt;) + 4 ε (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;)] / dr&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;σ&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; σ&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 48 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; - 24 ε σ&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) = 24 ε / σ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.3&amp;lt;/big&amp;gt;: 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;). &lt;br /&gt;
&lt;br /&gt;
When F = 0, r = r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
F (r) = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
0 = 48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;- 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
48 ε σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-13 &amp;lt;/sup&amp;gt;= 24 ε σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;12 &amp;lt;/sup&amp;gt;/ σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;&amp;lt;sup&amp;gt; &amp;lt;/sup&amp;gt;=  r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;13 &amp;lt;/sup&amp;gt; / r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2 σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;= r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ   &lt;br /&gt;
&lt;br /&gt;
When r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; = 2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ, &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε {[σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; /(2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;] - [σ&amp;lt;sup&amp;gt;6 &amp;lt;/sup&amp;gt;/ (2&amp;lt;sup&amp;gt;1/6&amp;lt;/sup&amp;gt; σ)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;]} &lt;br /&gt;
&lt;br /&gt;
Φ = 4 ε [(1/4) - (1/2)] &lt;br /&gt;
&lt;br /&gt;
Φ = - ε &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.4&amp;lt;/big&amp;gt;: Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When σ = ε = 1.0&lt;br /&gt;
&lt;br /&gt;
= ʃ 4 ε [(σ&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt; ) - (σ&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt; / r&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;)] dr&lt;br /&gt;
&lt;br /&gt;
= [-4 / 11 r&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt; + 4 / 5 r&amp;lt;sup&amp;gt;5&amp;lt;/sup&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;= -0.0248&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00818&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1 ml 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;
Density of water = 1 g cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 ml of water = 1 g &lt;br /&gt;
&lt;br /&gt;
No. of moles in 1 ml of water = 1 g ÷ 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 0.0556 mol&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 ml of water = 0.0556 mol × 6.022×10&amp;lt;sup&amp;gt;23 &amp;lt;/sup&amp;gt;= 3.34×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;molecules&lt;br /&gt;
&lt;br /&gt;
No. of moles of 10000 water molecules = 10000 ÷ 6.022×10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt;= 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 water molecules = 1.66×10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt;mol × 18.0 g mol&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;= 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g&lt;br /&gt;
&lt;br /&gt;
volume of 10000 water molecules = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;g ÷ 1 g cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; = 2.99×10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Periodic boundary condition states that boxes are repeated infinitely in all direction, hence, if one molecule exits the boundary of the original box, one molecule from the replicated box enters the original box through the opposite face to retain the number of molecules. As a result, we could work out the final position of the atom simply by adding the movement vector to its initial position vector, i.e. (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7). As the box had a dimension of (1.0, 1.0, 1.0), so the resulting position vector was (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* = r / σ&lt;br /&gt;
&lt;br /&gt;
r = r* σ&lt;br /&gt;
&lt;br /&gt;
r = (3.2)(0.34×10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
r = 1.088 nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Φ = - ε, as calculated above, and ε / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= 120K&lt;br /&gt;
&lt;br /&gt;
Φ = - 120 × k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Φ = - 1.66×10&amp;lt;sup&amp;gt;-21 &amp;lt;/sup&amp;gt;J ÷ 1000 × N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Φ = 0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T* = k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;T / ε&lt;br /&gt;
&lt;br /&gt;
T = T* ε / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = (1.5)(120)(k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;) / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
T = 1.5 × 120&lt;br /&gt;
&lt;br /&gt;
T = 180 K&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In liquid, molecules are held together by intermolecular bonds. Molecules are not fixed and can flow around, and have a certain average intermolecular distance. If the molecules are too far apart, the attractive interaction between them is not as strong as it used to and behaves as gas instead of liquid. In contrast, if molecules are too close together, they experience a repulsion force between them and would affect the liquid simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Equation of number density can be used to rationalise the relationship between the number density, and the lattice spacing, a.&lt;br /&gt;
&lt;br /&gt;
Case 1: In a simple cubic lattice, there is only 1 atom inside the lattice.&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
0.8 = 1 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.0772 m &lt;br /&gt;
&lt;br /&gt;
This result agreed with the value obtained from LAMMPS.&lt;br /&gt;
&lt;br /&gt;
Case 2: In a face-centred cubic lattice, there are 1 atom at each corner and 1 atom on each face. Atom at the corner and on the face contribute to 1/4 and 1/2 atom to the lattice. Hence, number of atom in a fcc lattice = 1/8 × 8 + 1/2 × 6 = 4&lt;br /&gt;
&lt;br /&gt;
number density = number of atom / volume&lt;br /&gt;
&lt;br /&gt;
1.2 = 4 / a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a = 1.494 m&lt;br /&gt;
&lt;br /&gt;
Therefore, a fcc lattice with a number density of 1.2 will have a side length of 1.494 m.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each fcc unit cell consists of 4 atoms. With the same 10×10×10 box, we are having 1000 unit cells, hence, fcc lattice will consist of 4×1000 = 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;mass I value&amp;lt;/pre&amp;gt;Mass command defines the mass of atoms, where I is the number of atom type and value is the mass of atom.&lt;br /&gt;
&lt;br /&gt;
In our case, there is only 1 type of atom and its mass is 1.0 in reduced unit.&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;Syntax of the command&amp;lt;pre&amp;gt;pair_style style args&amp;lt;/pre&amp;gt;pair_style command compute different styles of pairwise interaction. The second &amp;lt;nowiki&amp;gt;&#039;&#039;style&#039;&#039;&amp;lt;/nowiki&amp;gt; defines a particular type of pairwise interaction, and the &amp;lt;nowiki&amp;gt;&#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the arguments used by that particular style. In our case, lj/cut is used to compute the cutoff Lennard-Jones potential with no Coulomb, and the cutoff potential is set at 3.0 reduced unit.&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;Syntax of the command&lt;br /&gt;
&lt;br /&gt;
pair_coeff command specifies the pairwise force field coefficients for one or more pairs of atom types. &amp;lt;nowiki&amp;gt;&#039;&#039;I,J&#039;&#039; is the atom types and &#039;&#039;args&#039;&#039;&amp;lt;/nowiki&amp;gt; is the coefficients for one or more pairs of atom types. In out case, I and J equal * which means there is N types of atom and means all types from 1 to N, and both coefficients are set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are using Velocity Verlet Algorithm, see below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
Those extra lines would allow the variable to change automatically when timestep in the second line is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;[[File:total energy equilibration.PNG|thumbnail|thumb|350px|right|Fig6. Equilibration of total energy.]][[File:temperature equilibration.PNG|thumbnail|thumb|350px|right|Fig.7 Equilibration of Temperature.]][[File:pressure equilibration.PNG|thumbnail|thumb|350px|right|Fig.8 Equilibration of Pressure.]][[File:total energy at different timestep.PNG|thumbnail|thumb|350px|right|Fig.9 Total energy at different timestep.]]&lt;br /&gt;
&lt;br /&gt;
All three properties reached equilibrium after short period of time when timestep was 0.001 s. The total energy, temperature and pressure reached the equilibrium after approximately 0.42, 0.32 and 0.25 s respectively. When timestep was as large as 0.015 s, the total energy did not reach equilibrium. This was particularly bad for simulation. When the timestep was equal to or lower than 0.01 s, the energy did reach equilibrium. However, the fluctuation of the energy level was quite large when timestep equal 0.01 and 0.075 s. Also, the timestep cannot be too short, as it will lower the efficiency of the simulation. As a result, the most acceptable timestep for simulation to compensate both disadvantages was 0.0025 s.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In our simulation, timestep of 0.0025 s was used, as it allowed the oscillator to reach equilibrium and had a small fluctuation in energy level. The two pressures used were 2.55 and 2.65 atm, as there were inside the range of the pressure equilibrium from the last section. Finally, the temperature used were 1.7, 1.9, 2.1, 2.3 and 2.5, where all of them were above the critical temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{3T} = N k_B&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Sub &amp;lt;math&amp;gt;N k_B = \frac{\sum_i m_i v_i^2}{3T}&amp;lt;/math&amp;gt;, into &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} \frac{\sum_i m_i v_i^2}{3T} \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 is the Nevery, 1000 is the Nrepeat and 100000 is the Nfreq. Nevery defines how often are the input values is used for calculation, Nrepeat defines the number of times that the input values are used to calculate the average, and Nfreq defines the number of timestep for calculating an average. In our case, the input values are used every 100 timesteps, average calculated from input values are repeated for 1000 times, and the averages are calculated every 100000 timesteps. We used timestep of 0.0025 s, so our simulation time is 100000 x 0.0025 = 250 (reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:density vs temp.PNG|thumbnail|thumb|350px|right|Fig.10 Density vs. Temp at different pressure.]]&lt;br /&gt;
&lt;br /&gt;
Figure 10 showed that the simulated density decreases with temperature and increases with pressure respectively. This could be rationalised easily. As temperature increases, the molecules have higher kinetic energy and overcome the attractive interaction between molecules, thus a lower density. On the other hand, as pressure increases, the molecules are experiencing a greater force and are compressed together, thus a higher density.  The error in density was much smaller than the error in temperature, shown in figure 10. The simulated density was much lower than the density calculated from the ideal gas law. The ideal gas law does not take into account of the repulsive force between molecules, while the simulation was able to mimic the repulsive force. Therefore, the simulated density was lower than the calculated density as repulsive force between molecules pushed each other away. The discrepancy between simulated and calculated density increases with pressure. This could be rationalised by knowing that the gas behaves more as a real gas instead of ideal gas when pressure increase, hence the discrepancy increases.&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:heat capacity against temperature.png|350px|right|thumb|fig.11 heat capacity against temperature at different density]]&lt;br /&gt;
&lt;br /&gt;
Cv/V was plotted against temperature in figure 11. For both density, the simulation indicated the volume of the liquid remain unchanged, i.e. 16875 and 4218.75. The graph showed that the Cv/V decrease with temperature. The extent of decrease was greater when temperature was small and started to decrease slower as temperature increase gradually. However, there was an anomalous when T=2.4, D=0.8, which possibly arose due Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
Example of the script is shown below, where density is 0.2 and temperature is 2.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms 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;
&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;
&lt;br /&gt;
variable Cv 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;Heat Capacity: ${Cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Total Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;No of atoms square: ${N2}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations of the Lennard-Jones system were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.12 RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of RDF for solid, liquid and gas.PNG|thumbnail|thumb|350px|right|Fig.13 Integral of RDF for solid, liquid and gas.]]&lt;br /&gt;
&lt;br /&gt;
RDF provides the density of atoms at particular radius to a reference atom. Each peak in RDF indicates a particularly favoured separation distance for the neighbouring atoms to a reference atom. Thus, RDF reveals the atomic structure of the system being simulated. Figure 12 showed that RDF of solid had lots of sharp peaks, while there were only a few broad peaks in liquid, and just one broad peak for gas. It reveals atoms in solid are highly ordered and stays at particular distance to the reference atom. Sharp peak also indicates the atoms are not spread out randomly but are concentrated at favoured particular distances. The coordination number at favoured particular distance can be determined from the integral of RDF. In contrast, a few peaks in liquid RDF shows its system is less ordered and atoms are able to move around freely and rarely stay at a particular distance to the reference atom. Peaks still shows up illustrates that the atoms are still held together by some sort of attraction forces. On the other hand, broad peaks are observed in RDF of liquid and gas, where peak for gas is broader than those for liquid. This can be rationalised by the Brownian motion of the atoms in the system. The atoms in gas have higher energy, therefore, can move more randomly and resulted in a broad distribution at particular distance, where the only peak observed indicates the gas atoms are still interacting with each other. &lt;br /&gt;
&lt;br /&gt;
[[File:1st and 2nd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.14 1st and 2nd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
[[File:3rd coordinating neighbours of fcc.PNG|thumbnail|thumb|350px|right|Fig.15 3rd coordinating neighbours of fcc.]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks at the RDF of soild were at a, b and c. These corresponded to the first three nearest coordinating neighbours to a reference atom. The lattice spacing between the reference atom and the nearest neighbours can be calculated by Pythagoras theorem. It was found that the peaks in RDF were comparable to the calculated results. On the other hand, the integral of RDF, which is accumulative, showed the coordination number of the neighbouring atoms, and this agreed with the theoretical fcc model. See figure 14 and 15. Both peak and integral of RDF gave evidence that RDF can be used to determine lattice structure. From the simulation, we know the lattice spacing, a, is 1.47361. By visualising the fcc lattice model, we know the nearest neighbour has a separation of &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a&amp;lt;/math&amp;gt;, the second nearest neighbour has a separation of &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, and the third nearest neighbour has a separation of &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}a&amp;lt;/math&amp;gt;. The results were summarised in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! no of peak !! RDF Peak, Lattice spacing !! Calculated lattice spacing !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| First || a || 1.042 || 12&lt;br /&gt;
|-&lt;br /&gt;
| Second || b || 1.474 || 6&lt;br /&gt;
|-&lt;br /&gt;
| Third || c || 1. 805|| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following table shows the conditions under which the simulations were performed.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Temperature !! Density&lt;br /&gt;
|-&lt;br /&gt;
|Solid ||1.25 || 1.25&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 1.1 || 0.7&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.1 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of gas.png|350px|right|thumb|Fig.16 MSD of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of liquid.png|350px|right|thumb|Fig.17 MSD of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid.png|350px|right|thumb|Fig.18 MSD of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
From equation &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, &lt;br /&gt;
we can calculate D in reduced unit, D*, from the MSD-timestep graph, i.e. &amp;lt;math&amp;gt;D^{*} = \frac{1}{6} gradient&amp;lt;/math&amp;gt;. The timestep of the simulation was 0.002 s, therefore, &amp;lt;math&amp;gt;D=\frac{D^{*}}{0.002}&amp;lt;/math&amp;gt;. The results are illustrated in the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 4.28*  10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.121 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.92 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 4.39* 10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 3.00 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The D values obtained were expected. Gas had the highest D among the three, as gas molecules had the highest kinetic energy, and can move around freely with only a little restriction. Liquid had a smaller D value, while liquid molecules can move around freely, but have lower kinetic energy, pack closer together and have less space to move around. In contrast, solid had a very low D value of &amp;lt;math&amp;gt; 10^{-6} &amp;lt;/math&amp;gt;. It is because solid molecules have the least kinetic energy. Also, they are ordered in a rigid shape, and can only oscillate about its equilibrium position. On the other hand, Simulated data was similar to the 1 million atom data given, which showed consistency of the the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the oscillator is defined as &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 velocity is the first derivative of the position equation: &amp;lt;math&amp;gt; v = \frac{\mathrm{d}\mathbf{x\left(t\right)}}{\mathrm{d}t} = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substitute &amp;lt;math&amp;gt; v = -A\omega\sin(\omega t+\phi) &amp;lt;/math&amp;gt; into the &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we get: &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And&amp;lt;math&amp;gt; - A^{2} \omega^{2} &amp;lt;/math&amp;gt; can be cancelled out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin(\omega(t+\tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\omega \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)\sin((\omega t+\phi)+\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometry identity: &amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+\phi)cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\cos(\omega \tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(\omega t+\phi)cos(\omega t+\phi)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau)\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)+\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that Sine is an odd function and cosine is an even function. Also, odd function multiplies even function gives in an odd function. The integral of an odd function with a symmetrical limit becomes 0.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;\frac{\sin(\omega \tau)\int_{-\infty}^{\infty}\sin(\omega t+\phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And &amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 19 compared the VACF of the solid and liquid simulation and the normalised harmonic oscillator. Solid simulation showed a minima at timestep = 47, while liquid simulatoin did not give a minima, its VACF flucatuated about 0 after teimstep = 109. Minima was observed because there are atom collisions in the solid and liquid simulation, and caused change in direction. Moreover, collisions in Lennard-Jones system will lead to loss of velocity and loss of energy, hence, the VACF is no longer correlated with time after a period of time and remain at 0.  In contrast, harmonic oscillator is shown as a periodic function because there is no atom collision within the system. Therefore, no lost of energy and the oscillator will oscillate forever.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF.png|350px|right|thumb|Fig.19 VACF of solid, liquid and harmonic oscillator against timestep.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas !! D from MSD!! Solid !! Liquid !! Gas &lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data || &amp;lt;math&amp;gt; 5.51 * 10^{-4}&amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.113 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.885 &amp;lt;/math&amp;gt; || Simulated Data || 4.28*10^{-4} || 0.121|| 2.92||&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt; 2.78 * 10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0825 &amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.978 &amp;lt;/math&amp;gt; ||1 Million Atom Data || 4.39*10^{-4} || 0.0873 || 3.00||&lt;br /&gt;
|}&lt;br /&gt;
[[File:Integral of VACF of gas.png|350px|right|thumb|Fig.20 Integral of VACF of gas against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of liquid.png|350px|right|thumb|Fig.20 Integral of VACF of liquid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of solid.png|350px|right|thumb|Fig.20 Integral of VACF of solid against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million gas.png|350px|right|thumb|Fig.20 Integral of VACF of 1 million gas molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million liquid.png|350px|right|thumb|Fig.20 Integral of VACF of 1 million liquid molecules against timestep.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of VACF of 1 million solid .png|350px|right|thumb|Fig.20 Integral of VACF of 1 million solid against timestep.]]&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_1_million_solid_.png&amp;diff=543102</id>
		<title>File:Integral of VACF of 1 million solid .png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_1_million_solid_.png&amp;diff=543102"/>
		<updated>2016-02-25T20:06:04Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_1_million_liquid.png&amp;diff=543097</id>
		<title>File:Integral of VACF of 1 million liquid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_1_million_liquid.png&amp;diff=543097"/>
		<updated>2016-02-25T19:57:31Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_1_million_gas.png&amp;diff=543096</id>
		<title>File:Integral of VACF of 1 million gas.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_1_million_gas.png&amp;diff=543096"/>
		<updated>2016-02-25T19:57:07Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_solid.png&amp;diff=543094</id>
		<title>File:Integral of VACF of solid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_solid.png&amp;diff=543094"/>
		<updated>2016-02-25T19:56:44Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_liquid.png&amp;diff=543093</id>
		<title>File:Integral of VACF of liquid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_of_VACF_of_liquid.png&amp;diff=543093"/>
		<updated>2016-02-25T19:56:23Z</updated>

		<summary type="html">&lt;p&gt;Nhl13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nhl13</name></author>
	</entry>
</feed>