<?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=Mym113</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=Mym113"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Mym113"/>
	<updated>2026-04-05T17:14:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543291</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543291"/>
		<updated>2016-02-25T23:37:09Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
Table 1. Position of maxima and corresponding time&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|400px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|400px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|400px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
Table 2. Conditions for simulations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temp at different Pressure.PNG|thumb|550px|Figure 10. Density vs Temp at different Pressure]]&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure 10. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs Temperature.PNG|thumb|400px|Figure 11. Cv/V vs Temperature]]&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure 11 is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&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;
Table 3. Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Figure 12, all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
[[File:Radial Distribution Function.PNG|thumb|400px|Figure 12. Radial Distribution Function]]&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Figure 13). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Figure 14). In the third layer, there are 24 neighbours with distance 1.725 (Figure 15). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
[[File:1st layer 12 neighbour.PNG|thumb|350px|Figure 13. 1st layer 12 neighbour [1] ]]&lt;br /&gt;
[[File:2nd layer 6 neighbour.PNG|thumb|350px|Figure 14. 2nd layer 6 neighbour [1] ]]&lt;br /&gt;
[[File:3rd layer 24 neighbour.PNG|thumb|350px|Figure 15. 3rd layer 24 neighbour [1] ]]&lt;br /&gt;
&lt;br /&gt;
Table 4. Summary table of coordination number, distance and lattice spacing&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
[[File:Int g(r) dr.PNG|thumb|400px|Figure 16. Int g(r) dr]]&lt;br /&gt;
&lt;br /&gt;
Figure 16 below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure 17-19) and time (timestep x 0.002) (Figure 20-22). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Timestep.png|thumb|400px|Figure 17. MSD of solid vs Timestep]]&lt;br /&gt;
[[File:MSD of liquid vs Timestep.png|thumb|400px|Figure 18.MSD of liquid vs Timestep]]&lt;br /&gt;
[[File:MSD of vapour vs Timestep.png|thumb|400px|Figure 19. MSD of vapour vs Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Time.png|thumb|400px|Figure 20. MSD of solid vs Time]]&lt;br /&gt;
[[File:MSD of liquid vs Time.png|thumb|400px|Figure 21. MSD of liquid vs Time]]&lt;br /&gt;
[[File:MSD of vapour vs Time.png|thumb|400px|Figure 22. MSD of vapour vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is expected and this is the case observed in both simulated and one million atom results (Table 5). The results in the table above also shown agreement between simulated and much larger system results. MSD models the displacement of an atom in a finite volume. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for solids are very small as atoms are arranged regularly and closely packed, atoms have minimal or no movement. The change in MSD is due to atoms vibrating on its lattice site and as atoms vibrate, neighbouring atoms will be affected via intermolecular interactions and spread vibrational energy through the lattice structure. This explains why the MSD fluctuates throughout the simulated time frame. In liquid, atoms are arranged randomly and there are more spaces in between compared to solid state. Atomic motions like Brownian motion allows continuous collision between atoms and give rise to diffusive behaviour in liquid. Liquid has greater displacement of atoms compared to solid and thus a larger &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed. In vapour, atoms are far apart with lots of spacing in between and there is not much intermolecular interactions. Atoms are free to travel in the simulation box  and after a collision, there will be a much greater displacement and thus the largest &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed&lt;br /&gt;
&lt;br /&gt;
Table 5. D of solid, liquid and gas from MSD&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
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;
&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;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF for solid, liquid and harmonic oscillator.png|thumb|px400|Figure 23. VACF for solid, liquid and harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACFs for the liquid and solid system represent collisions. (Figure 23) Velocity of atoms changes after collision and because the velocity of an atom before and after collisions is different, the VACF decorrelates. The differences between the liquid and solid VACFs are due to different ways the atoms are packed. Solids are closely packed and regularly arranged and atoms cannot move significantly away from their lattice site to collide with another atom, change in velocity is smaller. More oscillations were observed in the VACF of solid. There are both positive and negative correlations before the velocity drops to zero. The reverse in velocity after each collision is shown as a minimum. For liquid, atoms are randomly arranged and have spaces in between; atoms can diffuse more and collide with another atom. Therefore no oscillating behavior that is seen in solid is observed. The velocity decays rapidly with time and only one minimum is observed in the VACF for liquid. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid because the motion is periodic, as shown on the graph. There is a specific velocity at an instant time. There is no collision between atoms and velocity of the atom does not change until it hits the boundary, which reverses the velocity. Atoms in Lennard Jones solid and liquid collide and thus are different from harmonic oscillator VACF.&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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table 6. Summary of D obtained from VACF and MSD for smaller and larger system.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !!&#039;&#039;&#039;D from MSD (simulated)&#039;&#039;&#039;!! &#039;&#039;&#039;D from MSD (one million atoms)&#039;&#039;&#039;!!&#039;&#039;D from VACF (simulated)&#039;&#039;&#039;!! &#039;&#039;&#039;D from VACF (one million atoms)&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid|| &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt;-4.56*10^{-4} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt;-2.79*10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid||&amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0794&amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.0825&amp;lt;/math&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Vapour||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt; 0.813 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.978&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule, the running integral of solid, liquid and vapour are plotted against timestep (Figure 24-39) and the diffusion coefficients are found by multiplying the integral by &amp;lt;math&amp;gt;\frac{1}{3}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Expected result of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is observed in both simulated and one million atom results (Table). The results in the table below show agreement between simulated and much larger system results. &lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimates of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; from VACF is the function &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt; only takes into account of velocity and does not take into account the initial position of the atoms. Also, the VACF &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is estimated using trapezium rule. The trapezium rule is a way of estimating the area under a curve. It works by splitting the area under a curve into a number of trapeziums, which can be calculated then adding the area of the trapeziums to obtain an approximation of the integral. The accuracy of the area is dependent on the height of the trapezium, in this case, the timestep. To increase the accuracy of the result, smaller increments can be used for calculation.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral of vapour (solid).png|thumb|350px|Figure 24. Running integral of solid (simulated)]]&lt;br /&gt;
[[File:Running integral of liquid(simulated).png|thumb|350px|Figure 25. Running integral of liquid(simulated)]]&lt;br /&gt;
[[File:Running integral of vapour (simulated).png|thumb|350px|Figure 26. Running integral of vapour (simulated)]]&lt;br /&gt;
[[File:Running integral of solid (one million atoms).png|thumb|350px|Figure 27. Running integral of solid (one million atoms)]]&lt;br /&gt;
[[File:Running integral of liquid (one million atoms).png|thumb|350px|Figure 28. Running integral of liquid (one million atoms)]]&lt;br /&gt;
[[File:Running integral of vapour (one million atoms).png|thumb|350px|Figure 29. Running integral of vapour (one million atoms)]]&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
[1] FCC And Its Neighbours, http://www.ifmpan.poznan.pl/~urbaniak/fcc%20and%20its%20neigbours01.pdf, 24 Feb 2016.&lt;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543271</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543271"/>
		<updated>2016-02-25T23:23:58Z</updated>

		<summary type="html">&lt;p&gt;Mym113: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
Table 1. Position of maxima and corresponding time&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|400px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|400px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|400px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
Table 2. Conditions for simulations&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temp at different Pressure.PNG|thumb|550px|Figure 10. Density vs Temp at different Pressure]]&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure 10. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs Temperature.PNG|thumb|400px|Figure 11. Cv/V vs Temperature]]&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure 11 is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&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;
Table 3. Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Figure 12, all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
[[File:Radial Distribution Function.PNG|thumb|400px|Figure 12. Radial Distribution Function]]&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Figure 13). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Figure 14). In the third layer, there are 24 neighbours with distance 1.725 (Figure 15). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
[[File:1st layer 12 neighbour.PNG|thumb|350px|Figure 13. 1st layer 12 neighbour [1] ]]&lt;br /&gt;
[[File:2nd layer 6 neighbour.PNG|thumb|350px|Figure 14. 2nd layer 6 neighbour [1] ]]&lt;br /&gt;
[[File:3rd layer 24 neighbour.PNG|thumb|350px|Figure 15. 3rd layer 24 neighbour [1] ]]&lt;br /&gt;
&lt;br /&gt;
Table 4. Summary table of coordination number, distance and lattice spacing&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
[[File:Int g(r) dr.PNG|thumb|400px|Figure 16. Int g(r) dr]]&lt;br /&gt;
&lt;br /&gt;
Figure 16 below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure 17-19) and time (timestep x 0.002) (Figure 20-22). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Timestep.png|thumb|400px|Figure 17. MSD of solid vs Timestep]]&lt;br /&gt;
[[File:MSD of liquid vs Timestep.png|thumb|400px|Figure 18.MSD of liquid vs Timestep]]&lt;br /&gt;
[[File:MSD of vapour vs Timestep.png|thumb|400px|Figure 19. MSD of vapour vs Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Time.png|thumb|400px|Figure 20. MSD of solid vs Time]]&lt;br /&gt;
[[File:MSD of liquid vs Time.png|thumb|400px|Figure 21. MSD of liquid vs Time]]&lt;br /&gt;
[[File:MSD of vapour vs Time.png|thumb|400px|Figure 22. MSD of vapour vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is expected and this is the case observed in both simulated and one million atom results (Table 5). The results in the table above also shown agreement between simulated and much larger system results. MSD models the displacement of an atom in a finite volume. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for solids are very small as atoms are arranged regularly and closely packed, atoms have minimal or no movement. The change in MSD is due to atoms vibrating on its lattice site and as atoms vibrate, neighbouring atoms will be affected via intermolecular interactions and spread vibrational energy through the lattice structure. This explains why the MSD fluctuates throughout the simulated time frame. In liquid, atoms are arranged randomly and there are more spaces in between compared to solid state. Atomic motions like Brownian motion allows continuous collision between atoms and give rise to diffusive behaviour in liquid. Liquid has greater displacement of atoms compared to solid and thus a larger &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed. In vapour, atoms are far apart with lots of spacing in between and there is not much intermolecular interactions. Atoms are free to travel in the simulation box  and after a collision, there will be a much greater displacement and thus the largest &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed&lt;br /&gt;
&lt;br /&gt;
Table 5. D of solid, liquid and gas from MSD&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
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;
&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;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF for solid, liquid and harmonic oscillator.png|thumb|px400|Figure 23. VACF for solid, liquid and harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACFs for the liquid and solid system represent collisions. (Figure 23) Velocity of atoms changes after collision and because the velocity of an atom before and after collisions is different, the VACF decorrelates. The differences between the liquid and solid VACFs are due to different ways the atoms are packed. Solids are closely packed and regularly arranged and atoms cannot move significantly away from their lattice site to collide with another atom, change in velocity is smaller. More oscillations were observed in the VACF of solid. There are both positive and negative correlations before the velocity drops to zero. The reverse in velocity after each collision is shown as a minimum. For liquid, atoms are randomly arranged and have spaces in between; atoms can diffuse more and collide with another atom. Therefore no oscillating behavior that is seen in solid is observed. The velocity decays rapidly with time and only one minimum is observed in the VACF for liquid. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid because the motion is periodic, as shown on the graph. There is a specific velocity at an instant time. There is no collision between atoms and velocity of the atom does not change until it hits the boundary, which reverses the velocity. Atoms in Lennard Jones solid and liquid collide and thus are different from harmonic oscillator VACF.&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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table 6. Summary of D obtained from VACF and MSD for smaller and larger system.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !!&#039;&#039;&#039;D from MSD (simulated)&#039;&#039;&#039;!! &#039;&#039;&#039;D from MSD (one million atoms)&#039;&#039;&#039;!!&#039;&#039;D from VACF (simulated)&#039;&#039;&#039;!! &#039;&#039;&#039;D from VACF (one million atoms)&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid|| &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt;-4.56*10^{-4} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt;-2.79*10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid||&amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0794&amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.0825&amp;lt;/math&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Vapour||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt; 0.813 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.978&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule, the running integral of solid, liquid and vapour are plotted against timestep (Figure 24-39) and the diffusion coefficients are found by multiplying the integral by &amp;lt;math&amp;gt;\frac{1}{3}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Expected result of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is observed in both simulated and one million atom results (Table). The results in the table below show agreement between simulated and much larger system results. &lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimates of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; from VACF is the function &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt; only takes into account of velocity and does not take into account the initial position of the atoms. Also, the VACF &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is estimated using trapezium rule. The trapezium rule is a way of estimating the area under a curve. It works by splitting the area under a curve into a number of trapeziums, which can be calculated then adding the area of the trapeziums to obtain an approximation of the integral. The accuracy of the area is dependent on the height of the trapezium, in this case, the timestep. To increase the accuracy of the result, smaller increments can be used for calculation.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral of vapour (solid).png|thumb|350px|Figure 24. Running integral of solid (simulated)]]&lt;br /&gt;
[[File:Running integral of liquid(simulated).png|thumb|350px|Figure 25. Running integral of liquid(simulated)]]&lt;br /&gt;
[[File:Running integral of vapour (simulated).png|thumb|350px|Figure 26. Running integral of vapour (simulated)]]&lt;br /&gt;
[[File:Running integral of solid (one million atoms).png|thumb|350px|Figure 27. Running integral of solid (one million atoms)]]&lt;br /&gt;
[[File:Running integral of liquid (one million atoms).png|thumb|350px|Figure 28. Running integral of liquid (one million atoms)]]&lt;br /&gt;
[[File:Running integral of solid (one million atoms).png|thumb|350px|Figure 29. Running integral of solid (one million atoms)]]&lt;br /&gt;
&lt;br /&gt;
===Reference===&lt;br /&gt;
[1] FCC And Its Neighbours, http://www.ifmpan.poznan.pl/~urbaniak/fcc%20and%20its%20neigbours01.pdf, 24 Feb 2016.&lt;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543262</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543262"/>
		<updated>2016-02-25T23:08:13Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Third year simulation experiment==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure 11 is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs Temperature.PNG|thumb|350px|Figure 11. Cv/V vs Temperature]]&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Figure 12, all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
[[File:Radial Distribution Function.PNG|thumb|350px|Figure 12. Radial Distribution Function]]&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Figure 13). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Figure 14). In the third layer, there are 24 neighbours with distance 1.725 (Figure 15). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
[[File:1st layer 12 neighbour.PNG|thumb|350px|Figure 13. 1st layer 12 neighbour]]&lt;br /&gt;
[[File:2nd layer 6 neighbour.PNG|thumb|350px|Figure 14. 2nd layer 6 neighbour]]&lt;br /&gt;
[[File:3rd layer 24 neighbour.PNG|thumb|350px|Figure 15. 3rd layer 24 neighbour]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Figure 16 below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&lt;br /&gt;
&lt;br /&gt;
[[File:Int g(r) dr.PNG|thumb|350px|Figure 16. Int g(r) dr]]&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure 17-19) and time (timestep x 0.002) (Figure 20-22). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table 5. D of solid, liquid and gas from MSD&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Timestep.png|thumb|350px|Figure 17. MSD of solid vs Timestep]]&lt;br /&gt;
[[File:MSD of liquid vs Timestep.png|thumb|350px|Figure 18.MSD of liquid vs Timestep]]&lt;br /&gt;
[[File:MSD of vapour vs Timestep.png|thumb|350px|Figure 19. MSD of vapour vs Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Time.png|thumb|350px|Figure 20. MSD of solid vs Time]]&lt;br /&gt;
[[File:MSD of liquid vs Time.png|thumb|350px|Figure 21. MSD of liquid vs Time]]&lt;br /&gt;
[[File:MSD of vapour vs Time.png|thumb|350px|Figure 22. MSD of vapour vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is expected and this is the case observed in both simulated and one million atom results (Table). The results in the table above also shown agreement between simulated and much larger system results. MSD models the displacement of an atom in a finite volume. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for solids are very small as atoms are arranged regularly and closely packed, atoms have minimal or no movement. The change in MSD is due to atoms vibrating on its lattice site and as atoms vibrate, neighbouring atoms will be affected via intermolecular interactions and spread vibrational energy through the lattice structure. This explains why the MSD fluctuates throughout the simulated time frame. In liquid, atoms are arranged randomly and there are more spaces in between compared to solid state. Atomic motions like Brownian motion allows continuous collision between atoms and give rise to diffusive behaviour in liquid. Liquid has greater displacement of atoms compared to solid and thus a larger &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed. In vapour, atoms are far apart with lots of spacing in between and there is not much intermolecular interactions. Atoms are free to travel in the simulation box  and after a collision, there will be a much greater displacement and thus the largest &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
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;
&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;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Minima in the VACFs for the liquid and solid system represent collisions. (Figure 23) Velocity of atoms changes after collision and because the velocity of an atom before and after collisions is different, the VACF decorrelates. The differences between the liquid and solid VACFs are due to different ways the atoms are packed. Solids are closely packed and regularly arranged and atoms cannot move significantly away from their lattice site to collide with another atom, change in velocity is smaller. More oscillations were observed in the VACF of solid. There are both positive and negative correlations before the velocity drops to zero. The reverse in velocity after each collision is shown as a minimum. For liquid, atoms are randomly arranged and have spaces in between; atoms can diffuse more and collide with another atom. Therefore no oscillating behavior that is seen in solid is observed. The velocity decays rapidly with time and only one minimum is observed in the VACF for liquid. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid because the motion is periodic, as shown on the graph. There is a specific velocity at an instant time. There is no collision between atoms and velocity of the atom does not change until it hits the boundary, which reverses the velocity. Atoms in Lennard Jones solid and liquid collide and thus are different from harmonic oscillator VACF.&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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table 6. Summary of D obtained from VACF and MSD for smaller and larger system.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !!&#039;&#039;&#039;D from MSD (simulated)&#039;&#039;&#039;!! &#039;&#039;&#039;D from MSD (one million atoms)&#039;&#039;&#039;!!&#039;&#039;D from VACF (simulated)&#039;&#039;&#039;!! &#039;&#039;&#039;D from VACF (one million atoms)&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid|| &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt;-4.56*10^{-4} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt;-2.79*10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid||&amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0794&amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.0825&amp;lt;/math&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Vapour||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt; 0.813 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.978&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule, the running integral of solid, liquid and vapour are plotted against timestep (Figure 24-39) and the diffusion coefficients are found by multiplying the integral by &amp;lt;math&amp;gt;\frac{1}{3}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Expected result of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is observed in both simulated and one million atom results (Table). The results in the table below show agreement between simulated and much larger system results. &lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimates of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; from VACF is the function &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt; only takes into account of velocity and does not take into account the initial position of the atoms. Also, the VACF &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is estimated using trapezium rule. The trapezium rule is a way of estimating the area under a curve. It works by splitting the area under a curve into a number of trapeziums, which can be calculated then adding the area of the trapeziums to obtain an approximation of the integral. The accuracy of the area is dependent on the height of the trapezium, in this case, the timestep. To increase the accuracy of the result, smaller increments can be used for calculation.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral of vapour (solid).png|thumb|350px|Figure 24. Running integral of solid (simulated)]]&lt;br /&gt;
[[File:Running integral of liquid(simulated).png|thumb|350px|Figure 25. Running integral of liquid(simulated)]]&lt;br /&gt;
[[File:Running integral of vapour (simulated).png|thumb|350px|Figure 26. Running integral of vapour (simulated)]]&lt;br /&gt;
[[File:Running integral of solid (one million atoms).png|thumb|350px|Figure 27. Running integral of solid (one million atoms)]]&lt;br /&gt;
[[File:Running integral of liquid (one million atoms).png|thumb|350px|Figure 28. Running integral of liquid (one million atoms)]]&lt;br /&gt;
[[File:Running integral of solid (one million atoms).png|thumb|350px|Figure 29. Running integral of solid (one million atoms)]]&lt;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543258</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543258"/>
		<updated>2016-02-25T23:02:09Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure 11 is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs Temperature.PNG|thumb|350px|Figure 11. Cv/V vs Temperature]]&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Figure 12, all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
[[File:Radial Distribution Function.PNG|thumb|350px|Figure 12. Radial Distribution Function]]&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Figure 13). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Figure 14). In the third layer, there are 24 neighbours with distance 1.725 (Figure 15). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
[[File:1st layer 12 neighbour.PNG|thumb|350px|Figure 13. 1st layer 12 neighbour]]&lt;br /&gt;
[[File:2nd layer 6 neighbour.PNG|thumb|350px|Figure 14. 2nd layer 6 neighbour]]&lt;br /&gt;
[[File:3rd layer 24 neighbour.PNG|thumb|350px|Figure 15. 3rd layer 24 neighbour]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Figure 16 below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&lt;br /&gt;
&lt;br /&gt;
[[File:Int g(r) dr.PNG|thumb|350px|Figure 16. Int g(r) dr]]&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure 17-19) and time (timestep x 0.002) (Figure 20-22). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table 5. D of solid, liquid and gas from MSD&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Timestep.png|thumb|350px|Figure 17. MSD of solid vs Timestep]]&lt;br /&gt;
[[File:MSD of liquid vs Timestep.png|thumb|350px|Figure 18.MSD of liquid vs Timestep]]&lt;br /&gt;
[[File:MSD of vapour vs Timestep.png|thumb|350px|Figure 19. MSD of vapour vs Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Time.png|thumb|350px|Figure 20. MSD of solid vs Time]]&lt;br /&gt;
[[File:MSD of liquid vs Time.png|thumb|350px|Figure 21. MSD of liquid vs Time]]&lt;br /&gt;
[[File:MSD of vapour vs Time.png|thumb|350px|Figure 22. MSD of vapour vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is expected and this is the case observed in both simulated and one million atom results (Table). The results in the table above also shown agreement between simulated and much larger system results. MSD models the displacement of an atom in a finite volume. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for solids are very small as atoms are arranged regularly and closely packed, atoms have minimal or no movement. The change in MSD is due to atoms vibrating on its lattice site and as atoms vibrate, neighbouring atoms will be affected via intermolecular interactions and spread vibrational energy through the lattice structure. This explains why the MSD fluctuates throughout the simulated time frame. In liquid, atoms are arranged randomly and there are more spaces in between compared to solid state. Atomic motions like Brownian motion allows continuous collision between atoms and give rise to diffusive behaviour in liquid. Liquid has greater displacement of atoms compared to solid and thus a larger &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed. In vapour, atoms are far apart with lots of spacing in between and there is not much intermolecular interactions. Atoms are free to travel in the simulation box  and after a collision, there will be a much greater displacement and thus the largest &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
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;
&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;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Minima in the VACFs for the liquid and solid system represent collisions. (Figure 23) Velocity of atoms changes after collision and because the velocity of an atom before and after collisions is different, the VACF decorrelates. The differences between the liquid and solid VACFs are due to different ways the atoms are packed. Solids are closely packed and regularly arranged and atoms cannot move significantly away from their lattice site to collide with another atom, change in velocity is smaller. More oscillations were observed in the VACF of solid. There are both positive and negative correlations before the velocity drops to zero. The reverse in velocity after each collision is shown as a minimum. For liquid, atoms are randomly arranged and have spaces in between; atoms can diffuse more and collide with another atom. Therefore no oscillating behavior that is seen in solid is observed. The velocity decays rapidly with time and only one minimum is observed in the VACF for liquid. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid because the motion is periodic, as shown on the graph. There is a specific velocity at an instant time. There is no collision between atoms and velocity of the atom does not change until it hits the boundary, which reverses the velocity. Atoms in Lennard Jones solid and liquid collide and thus are different from harmonic oscillator VACF.&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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table 6. Summary of D obtained from VACF and MSD for smaller and larger system.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !!&#039;&#039;&#039;D from MSD (simulated)&#039;&#039;&#039;!! &#039;&#039;&#039;D from MSD (one million atoms)&#039;&#039;&#039;!!&#039;&#039;D from VACF (simulated)&#039;&#039;&#039;!! &#039;&#039;&#039;D from VACF (one million atoms)&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid|| &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt;-4.56*10^{-4} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt;-2.79*10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid||&amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0794&amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.0825&amp;lt;/math&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Vapour||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt; 0.813 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.978&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule, the running integral of solid, liquid and vapour are plotted against timestep (Figure 24-39) and the diffusion coefficients are found by multiplying the integral by &amp;lt;math&amp;gt;\frac{1}{3}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Expected result of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is observed in both simulated and one million atom results (Table). The results in the table below show agreement between simulated and much larger system results. &lt;br /&gt;
&lt;br /&gt;
The largest source of error in estimates of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; from VACF is the function &amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt; only takes into account of velocity and does not take into account the initial position of the atoms. Also, the VACF &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is estimated using trapezium rule. The trapezium rule is a way of estimating the area under a curve. It works by splitting the area under a curve into a number of trapeziums, which can be calculated then adding the area of the trapeziums to obtain an approximation of the integral. The accuracy of the area is dependent on the height of the trapezium, in this case, the timestep. To increase the accuracy of the result, smaller increments can be used for calculation.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral of vapour (solid).png|thumb|350px|Figure 24. Running integral of solid (simulated)]]&lt;br /&gt;
[[File:Running integral of liquid(simulated).png|thumb|350px|Figure 25. Running integral of liquid(simulated)]]&lt;br /&gt;
[[File:Running integral of vapour (simulated).png|thumb|350px|Figure 26. Running integral of vapour (simulated)]]&lt;br /&gt;
[[File:Running integral of solid (one million atoms).png|thumb|350px|Figure 27. Running integral of solid (one million atoms)]]&lt;br /&gt;
[[File:Running integral of liquid (one million atoms).png|thumb|350px|Figure 28. Running integral of liquid (one million atoms)]]&lt;br /&gt;
[[File:Running integral of solid (one million atoms).png|thumb|350px|Figure 29. Running integral of solid (one million atoms)]]&lt;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543237</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543237"/>
		<updated>2016-02-25T22:34:24Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure 11 is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs Temperature.PNG|thumb|350px|Figure 11. Cv/V vs Temperature]]&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Figure 12, all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
[[File:Radial Distribution Function.PNG|thumb|350px|Figure 12. Radial Distribution Function]]&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Figure 13). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Figure 14). In the third layer, there are 24 neighbours with distance 1.725 (Figure 15). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
[[File:1st layer 12 neighbour.PNG|thumb|350px|Figure 13. 1st layer 12 neighbour]]&lt;br /&gt;
[[File:2nd layer 6 neighbour.PNG|thumb|350px|Figure 14. 2nd layer 6 neighbour]]&lt;br /&gt;
[[File:3rd layer 24 neighbour.PNG|thumb|350px|Figure 15. 3rd layer 24 neighbour]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Figure 16 below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&lt;br /&gt;
&lt;br /&gt;
[[File:Int g(r) dr.PNG|thumb|350px|Figure 16. Int g(r) dr]]&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure 17-19) and time (timestep x 0.002) (Figure 20-22). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Timestep.png|thumb|350px|Figure 17. MSD of solid vs Timestep]]&lt;br /&gt;
[[File:MSD of liquid vs Timestep.png|thumb|350px|Figure 18.MSD of liquid vs Timestep]]&lt;br /&gt;
[[File:MSD of vapour vs Timestep.png|thumb|350px|Figure 19. MSD of vapour vs Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Time.png|thumb|350px|Figure 20. MSD of solid vs Time]]&lt;br /&gt;
[[File:MSD of liquid vs Time.png|thumb|350px|Figure 21. MSD of liquid vs Time]]&lt;br /&gt;
[[File:MSD of vapour vs Time.png|thumb|350px|Figure 22. MSD of vapour vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is expected and this is the case observed in both simulated and one million atom results (Table). The results in the table above also shown agreement between simulated and much larger system results. MSD models the displacement of an atom in a finite volume. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for solids are very small as atoms are arranged regularly and closely packed, atoms have minimal or no movement. The change in MSD is due to atoms vibrating on its lattice site and as atoms vibrate, neighbouring atoms will be affected via intermolecular interactions and spread vibrational energy through the lattice structure. This explains why the MSD fluctuates throughout the simulated time frame. In liquid, atoms are arranged randomly and there are more spaces in between compared to solid state. Atomic motions like Brownian motion allows continuous collision between atoms and give rise to diffusive behaviour in liquid. Liquid has greater displacement of atoms compared to solid and thus a larger &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed. In vapour, atoms are far apart with lots of spacing in between and there is not much intermolecular interactions. Atoms are free to travel in the simulation box  and after a collision, there will be a much greater displacement and thus the largest &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
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;
&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;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Minima in the VACFs for the liquid and solid system represent collisions. Velocity of atoms changes after collision and because the velocity of an atom before and after collisions is different, the VACF decorrelates. The differences between the liquid and solid VACFs are due to different ways the atoms are packed. Solids are closely packed and regularly arranged and atoms cannot move significantly away from their lattice site to collide with another atom, change in velocity is smaller. More oscillations were observed in the VACF of solid. There are both positive and negative correlations before the velocity drops to zero. The reverse in velocity after each collision is shown as a minimum. For liquid, atoms are randomly arranged and have spaces in between; atoms can diffuse more and collide with another atom. Therefore no oscillating behavior that is seen in solid is observed. The velocity decays rapidly with time and only one minimum is observed in the VACF for liquid. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid because the motion is periodic, as shown on the graph. There is a specific velocity at an instant time. There is no collision between atoms and velocity of the atom does not change until it hits the boundary, which reverses the velocity. Atoms in Lennard Jones solid and liquid collide and thus are different from harmonic oscillator VACF.&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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from VACF&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data ||&amp;lt;math&amp;gt;-4.56*10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0794&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.813 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt;-2.79*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;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !!&#039;&#039;&#039;D from MSD (simulated)&#039;&#039;&#039;!! &#039;&#039;&#039;D from MSD (one million atoms)&#039;&#039;&#039;!!&#039;&#039;D from VACF (simulated)&#039;&#039;&#039;!! &#039;&#039;&#039;D from VACF (one million atoms)&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid|| &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt;-4.56*10^{-4} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt;-2.79*10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid||&amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0794&amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.0825&amp;lt;/math&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Vapour||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt; 0.813 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.978&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543232</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543232"/>
		<updated>2016-02-25T22:26:21Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure 11 is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs Temperature.PNG|thumb|350px|Figure 11. Cv/V vs Temperature]]&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Figure 12, all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
[[File:Radial Distribution Function.PNG|thumb|350px|Figure 12. Radial Distribution Function]]&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Figure 13). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Figure 14). In the third layer, there are 24 neighbours with distance 1.725 (Figure 15). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
[[File:1st layer 12 neighbour.PNG|thumb|350px|Figure 13. 1st layer 12 neighbour]]&lt;br /&gt;
[[File:2nd layer 6 neighbour.PNG|thumb|350px|Figure 14. 2nd layer 6 neighbour]]&lt;br /&gt;
[[File:3rd layer 24 neighbour.PNG|thumb|350px|Figure 15. 3rd layer 24 neighbour]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Figure 16 below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&lt;br /&gt;
&lt;br /&gt;
[[File:Int g(r) dr.PNG|thumb|350px|Figure 16. Int g(r) dr]]&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure 17-19) and time (timestep x 0.002) (Figure 20-22). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Timestep.png|thumb|350px|Figure 17. MSD of solid vs Timestep]]&lt;br /&gt;
[[File:MSD of liquid vs Timestep.png|thumb|350px|Figure 18.MSD of liquid vs Timestep]]&lt;br /&gt;
[[File:MSD of vapour vs Timestep.png|thumb|350px|Figure 19. MSD of vapour vs Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Time.png|thumb|350px|Figure 20. MSD of solid vs Time]]&lt;br /&gt;
[[File:MSD of liquid vs Time.png|thumb|350px|Figure 21. MSD of liquid vs Time]]&lt;br /&gt;
[[File:MSD of vapour vs Time.png|thumb|350px|Figure 22. MSD of vapour vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is expected and this is the case observed in both simulated and one million atom results (Table). The results in the table above also shown agreement between simulated and much larger system results. MSD models the displacement of an atom in a finite volume. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for solids are very small as atoms are arranged regularly and closely packed, atoms have minimal or no movement. The change in MSD is due to atoms vibrating on its lattice site and as atoms vibrate, neighbouring atoms will be affected via intermolecular interactions and spread vibrational energy through the lattice structure. This explains why the MSD fluctuates throughout the simulated time frame. In liquid, atoms are arranged randomly and there are more spaces in between compared to solid state. Atomic motions like Brownian motion allows continuous collision between atoms and give rise to diffusive behaviour in liquid. Liquid has greater displacement of atoms compared to solid and thus a larger &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed. In vapour, atoms are far apart with lots of spacing in between and there is not much intermolecular interactions. Atoms are free to travel in the simulation box  and after a collision, there will be a much greater displacement and thus the largest &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
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;
&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;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Minima in the VACFs for the liquid and solid system represent collisions. Velocity of atoms changes after collision and because the velocity of an atom before and after collisions is different, the VACF decorrelates. The differences between the liquid and solid VACFs are due to different ways the atoms are packed. Solids are closely packed and regularly arranged and atoms cannot move significantly away from their lattice site to collide with another atom, change in velocity is smaller. More oscillations were observed in the VACF of solid. There are both positive and negative correlations before the velocity drops to zero. The reverse in velocity after each collision is shown as a minimum. For liquid, atoms are randomly arranged and have spaces in between; atoms can diffuse more and collide with another atom. Therefore no oscillating behavior that is seen in solid is observed. The velocity decays rapidly with time and only one minimum is observed in the VACF for liquid. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid because the motion is periodic, as shown on the graph. There is a specific velocity at an instant time. There is no collision between atoms and velocity of the atom does not change until it hits the boundary, which reverses the velocity. Atoms in Lennard Jones solid and liquid collide and thus are different from harmonic oscillator VACF.&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&lt;br /&gt;
|-&lt;br /&gt;
| Simulated Data ||&amp;lt;math&amp;gt;-4.56*10^{-4} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0794&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt; 0.813 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom Data || &amp;lt;math&amp;gt;-2.79*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;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| {{table}}&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;Phases&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;D obtained from MSD (simulated)&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;D obtained from MSD (1 million atoms)&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;D obtained from VACF (simulated)&#039;&#039;&#039;&lt;br /&gt;
| align=&amp;quot;center&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|&#039;&#039;&#039;D obtained from VACF (1 million atoms)&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid|| &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt;-4.56*10^{-4} &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt;-2.79*10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid||&amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0794&amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.0825&amp;lt;/math&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Vapour||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt; 0.813 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 0.978&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543204</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543204"/>
		<updated>2016-02-25T21:55:14Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure 11 is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs Temperature.PNG|thumb|350px|Figure 11. Cv/V vs Temperature]]&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Figure 12, all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
[[File:Radial Distribution Function.PNG|thumb|350px|Figure 12. Radial Distribution Function]]&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Figure 13). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Figure 14). In the third layer, there are 24 neighbours with distance 1.725 (Figure 15). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
[[File:1st layer 12 neighbour.PNG|thumb|350px|Figure 13. 1st layer 12 neighbour]]&lt;br /&gt;
[[File:2nd layer 6 neighbour.PNG|thumb|350px|Figure 14. 2nd layer 6 neighbour]]&lt;br /&gt;
[[File:3rd layer 24 neighbour.PNG|thumb|350px|Figure 15. 3rd layer 24 neighbour]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Figure 16 below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&lt;br /&gt;
&lt;br /&gt;
[[File:Int g(r) dr.PNG|thumb|350px|Figure 16. Int g(r) dr]]&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure 17-19) and time (timestep x 0.002) (Figure 20-22). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Timestep.png|thumb|350px|Figure 17. MSD of solid vs Timestep]]&lt;br /&gt;
[[File:MSD of liquid vs Timestep.png|thumb|350px|Figure 18.MSD of liquid vs Timestep]]&lt;br /&gt;
[[File:MSD of vapour vs Timestep.png|thumb|350px|Figure 19. MSD of vapour vs Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD of solid vs Time.png|thumb|350px|Figure 20. MSD of solid vs Time]]&lt;br /&gt;
[[File:MSD of liquid vs Time.png|thumb|350px|Figure 21. MSD of liquid vs Time]]&lt;br /&gt;
[[File:MSD of vapour vs Time.png|thumb|350px|Figure 22. MSD of vapour vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is expected and this is the case observed in both simulated and one million atom results (Table). The results in the table above also shown agreement between simulated and much larger system results. MSD models the displacement of an atom in a finite volume. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for solids are very small as atoms are arranged regularly and closely packed, atoms have minimal or no movement. The change in MSD is due to atoms vibrating on its lattice site and as atoms vibrate, neighbouring atoms will be affected via intermolecular interactions and spread vibrational energy through the lattice structure. This explains why the MSD fluctuates throughout the simulated time frame. In liquid, atoms are arranged randomly and there are more spaces in between compared to solid state. Atomic motions like Brownian motion allows continuous collision between atoms and give rise to diffusive behaviour in liquid. Liquid has greater displacement of atoms compared to solid and thus a larger &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed. In vapour, atoms are far apart with lots of spacing in between and there is not much intermolecular interactions. Atoms are free to travel in the simulation box  and after a collision, there will be a much greater displacement and thus the largest &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
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;
&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;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Minima in the VACFs for the liquid and solid system represent collisions. Velocity of atoms changes after collision and because the velocity of an atom before and after collisions is different, the VACF decorrelates. The differences between the liquid and solid VACFs are due to different ways the atoms are packed. Solids are closely packed and regularly arranged and atoms cannot move significantly away from their lattice site to collide with another atom, change in velocity is smaller. More oscillations were observed in the VACF of solid. There are both positive and negative correlations before the velocity drops to zero. The reverse in velocity after each collision is shown as a minimum. For liquid, atoms are randomly arranged and have spaces in between; atoms can diffuse more and collide with another atom. Therefore no oscillating behavior that is seen in solid is observed. The velocity decays rapidly with time and only one minimum is observed in the VACF for liquid. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid because the motion is periodic, as shown on the graph. There is a specific velocity at an instant time. There is no collision between atoms and velocity of the atom does not change until it hits the boundary, which reverses the velocity. Atoms in Lennard Jones solid and liquid collide and thus are different from harmonic oscillator VACF.&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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543177</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543177"/>
		<updated>2016-02-25T21:28:00Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure 11 is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs Temperature.PNG|thumb|350px|Figure 11. Cv/V vs Temperature]]&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Figure 12, all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
[[File:Radial Distribution Function.PNG|thumb|350px|Figure 12. Radial Distribution Function]]&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Figure 13). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Figure 14). In the third layer, there are 24 neighbours with distance 1.725 (Figure 15). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
[[File:1st layer 12 neighbour.PNG|thumb|350px|Figure 13. 1st layer 12 neighbour]]&lt;br /&gt;
[[File:2nd layer 6 neighbour.PNG|thumb|350px|Figure 14. 2nd layer 6 neighbour]]&lt;br /&gt;
[[File:3rd layer 24 neighbour.PNG|thumb|350px|Figure 15. 3rd layer 24 neighbour]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Figure 16 below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&lt;br /&gt;
&lt;br /&gt;
[[File:Int g(r) dr.PNG|thumb|350px|Figure 16. Int g(r) dr]]&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure) and time (timestep x 0.002) (Figure). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is expected and this is the case observed in both simulated and one million atom results (Table). The results in the table above also shown agreement between simulated and much larger system results. MSD models the displacement of an atom in a finite volume. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for solids are very small as atoms are arranged regularly and closely packed, atoms have minimal or no movement. The change in MSD is due to atoms vibrating on its lattice site and as atoms vibrate, neighbouring atoms will be affected via intermolecular interactions and spread vibrational energy through the lattice structure. This explains why the MSD fluctuates throughout the simulated time frame. In liquid, atoms are arranged randomly and there are more spaces in between compared to solid state. Atomic motions like Brownian motion allows continuous collision between atoms and give rise to diffusive behaviour in liquid. Liquid has greater displacement of atoms compared to solid and thus a larger &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed. In vapour, atoms are far apart with lots of spacing in between and there is not much intermolecular interactions. Atoms are free to travel in the simulation box  and after a collision, there will be a much greater displacement and thus the largest &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
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;
&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;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Minima in the VACFs for the liquid and solid system represent collisions. Velocity of atoms changes after collision and because the velocity of an atom before and after collisions is different, the VACF decorrelates. The differences between the liquid and solid VACFs are due to different ways the atoms are packed. Solids are closely packed and regularly arranged and atoms cannot move significantly away from their lattice site to collide with another atom, change in velocity is smaller. More oscillations were observed in the VACF of solid. There are both positive and negative correlations before the velocity drops to zero. The reverse in velocity after each collision is shown as a minimum. For liquid, atoms are randomly arranged and have spaces in between; atoms can diffuse more and collide with another atom. Therefore no oscillating behavior that is seen in solid is observed. The velocity decays rapidly with time and only one minimum is observed in the VACF for liquid. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid because the motion is periodic, as shown on the graph. There is a specific velocity at an instant time. There is no collision between atoms and velocity of the atom does not change until it hits the boundary, which reverses the velocity. Atoms in Lennard Jones solid and liquid collide and thus are different from harmonic oscillator VACF.&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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543172</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543172"/>
		<updated>2016-02-25T21:22:00Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Calculating heat capacities using statistical physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure 11 is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs Temperature.PNG|thumb|350px|Figure 11. Cv/V vs Temperature]]&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure) and time (timestep x 0.002) (Figure). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is expected and this is the case observed in both simulated and one million atom results (Table). The results in the table above also shown agreement between simulated and much larger system results. MSD models the displacement of an atom in a finite volume. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for solids are very small as atoms are arranged regularly and closely packed, atoms have minimal or no movement. The change in MSD is due to atoms vibrating on its lattice site and as atoms vibrate, neighbouring atoms will be affected via intermolecular interactions and spread vibrational energy through the lattice structure. This explains why the MSD fluctuates throughout the simulated time frame. In liquid, atoms are arranged randomly and there are more spaces in between compared to solid state. Atomic motions like Brownian motion allows continuous collision between atoms and give rise to diffusive behaviour in liquid. Liquid has greater displacement of atoms compared to solid and thus a larger &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed. In vapour, atoms are far apart with lots of spacing in between and there is not much intermolecular interactions. Atoms are free to travel in the simulation box  and after a collision, there will be a much greater displacement and thus the largest &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
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;
&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;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Minima in the VACFs for the liquid and solid system represent collisions. Velocity of atoms changes after collision and because the velocity of an atom before and after collisions is different, the VACF decorrelates. The differences between the liquid and solid VACFs are due to different ways the atoms are packed. Solids are closely packed and regularly arranged and atoms cannot move significantly away from their lattice site to collide with another atom, change in velocity is smaller. More oscillations were observed in the VACF of solid. There are both positive and negative correlations before the velocity drops to zero. The reverse in velocity after each collision is shown as a minimum. For liquid, atoms are randomly arranged and have spaces in between; atoms can diffuse more and collide with another atom. Therefore no oscillating behavior that is seen in solid is observed. The velocity decays rapidly with time and only one minimum is observed in the VACF for liquid. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid because the motion is periodic, as shown on the graph. There is a specific velocity at an instant time. There is no collision between atoms and velocity of the atom does not change until it hits the boundary, which reverses the velocity. Atoms in Lennard Jones solid and liquid collide and thus are different from harmonic oscillator VACF.&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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543171</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543171"/>
		<updated>2016-02-25T21:20:18Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Calculating heat capacities using statistical physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&lt;br /&gt;
&lt;br /&gt;
[[File:CvV vs Temperature.PNG|thumb|350px|CvV vs Temperature]]&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure) and time (timestep x 0.002) (Figure). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is expected and this is the case observed in both simulated and one million atom results (Table). The results in the table above also shown agreement between simulated and much larger system results. MSD models the displacement of an atom in a finite volume. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for solids are very small as atoms are arranged regularly and closely packed, atoms have minimal or no movement. The change in MSD is due to atoms vibrating on its lattice site and as atoms vibrate, neighbouring atoms will be affected via intermolecular interactions and spread vibrational energy through the lattice structure. This explains why the MSD fluctuates throughout the simulated time frame. In liquid, atoms are arranged randomly and there are more spaces in between compared to solid state. Atomic motions like Brownian motion allows continuous collision between atoms and give rise to diffusive behaviour in liquid. Liquid has greater displacement of atoms compared to solid and thus a larger &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed. In vapour, atoms are far apart with lots of spacing in between and there is not much intermolecular interactions. Atoms are free to travel in the simulation box  and after a collision, there will be a much greater displacement and thus the largest &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
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;
&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;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Minima in the VACFs for the liquid and solid system represent collisions. Velocity of atoms changes after collision and because the velocity of an atom before and after collisions is different, the VACF decorrelates. The differences between the liquid and solid VACFs are due to different ways the atoms are packed. Solids are closely packed and regularly arranged and atoms cannot move significantly away from their lattice site to collide with another atom, change in velocity is smaller. More oscillations were observed in the VACF of solid. There are both positive and negative correlations before the velocity drops to zero. The reverse in velocity after each collision is shown as a minimum. For liquid, atoms are randomly arranged and have spaces in between; atoms can diffuse more and collide with another atom. Therefore no oscillating behavior that is seen in solid is observed. The velocity decays rapidly with time and only one minimum is observed in the VACF for liquid. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid because the motion is periodic, as shown on the graph. There is a specific velocity at an instant time. There is no collision between atoms and velocity of the atom does not change until it hits the boundary, which reverses the velocity. Atoms in Lennard Jones solid and liquid collide and thus are different from harmonic oscillator VACF.&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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543168</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543168"/>
		<updated>2016-02-25T21:17:37Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure) and time (timestep x 0.002) (Figure). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is expected and this is the case observed in both simulated and one million atom results (Table). The results in the table above also shown agreement between simulated and much larger system results. MSD models the displacement of an atom in a finite volume. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for solids are very small as atoms are arranged regularly and closely packed, atoms have minimal or no movement. The change in MSD is due to atoms vibrating on its lattice site and as atoms vibrate, neighbouring atoms will be affected via intermolecular interactions and spread vibrational energy through the lattice structure. This explains why the MSD fluctuates throughout the simulated time frame. In liquid, atoms are arranged randomly and there are more spaces in between compared to solid state. Atomic motions like Brownian motion allows continuous collision between atoms and give rise to diffusive behaviour in liquid. Liquid has greater displacement of atoms compared to solid and thus a larger &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed. In vapour, atoms are far apart with lots of spacing in between and there is not much intermolecular interactions. Atoms are free to travel in the simulation box  and after a collision, there will be a much greater displacement and thus the largest &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
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;
&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;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Minima in the VACFs for the liquid and solid system represent collisions. Velocity of atoms changes after collision and because the velocity of an atom before and after collisions is different, the VACF decorrelates. The differences between the liquid and solid VACFs are due to different ways the atoms are packed. Solids are closely packed and regularly arranged and atoms cannot move significantly away from their lattice site to collide with another atom, change in velocity is smaller. More oscillations were observed in the VACF of solid. There are both positive and negative correlations before the velocity drops to zero. The reverse in velocity after each collision is shown as a minimum. For liquid, atoms are randomly arranged and have spaces in between; atoms can diffuse more and collide with another atom. Therefore no oscillating behavior that is seen in solid is observed. The velocity decays rapidly with time and only one minimum is observed in the VACF for liquid. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid because the motion is periodic, as shown on the graph. There is a specific velocity at an instant time. There is no collision between atoms and velocity of the atom does not change until it hits the boundary, which reverses the velocity. Atoms in Lennard Jones solid and liquid collide and thus are different from harmonic oscillator VACF.&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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543133</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543133"/>
		<updated>2016-02-25T20:41:03Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure) and time (timestep x 0.002) (Figure). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is expected and this is the case observed in both simulated and one million atom results (Table). The results in the table above also shown agreement between simulated and much larger system results. MSD models the displacement of an atom in a finite volume. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for solids are very small as atoms are arranged regularly and closely packed, atoms have minimal or no movement. The change in MSD is due to atoms vibrating on its lattice site and as atoms vibrate, neighbouring atoms will be affected via intermolecular interactions and spread vibrational energy through the lattice structure. This explains why the MSD fluctuates throughout the simulated time frame. In liquid, atoms are arranged randomly and there are more spaces in between compared to solid state. Atomic motions like Brownian motion allows continuous collision between atoms and give rise to diffusive behaviour in liquid. Liquid has greater displacement of atoms compared to solid and thus a larger &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed. In vapour, atoms are far apart with lots of spacing in between and there is not much intermolecular interactions. Atoms are free to travel in the simulation box  and after a collision, there will be a much greater displacement and thus the largest &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
Substitute the result obtained into the VACF,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Minima in the VACFs for the liquid and solid system represent collisions. Velocity of atoms changes after collision and because the velocity of an atom before and after collisions is different, the VACF decorrelates. The differences between the liquid and solid VACFs are due to different ways the atoms are packed. Solids are closely packed and regularly arranged and atoms cannot move significantly away from their lattice site to collide with another atom, change in velocity is smaller. More oscillations were observed in the VACF of solid. There are both positive and negative correlations before the velocity drops to zero. The reverse in velocity after each collision is shown as a minimum. For liquid, atoms are randomly arranged and have spaces in between; atoms can diffuse more and collide with another atom. Therefore no oscillating behavior that is seen in solid is observed. The velocity decays rapidly with time and only one minimum is observed in the VACF for liquid. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid because the motion is periodic, as shown on the graph. There is a specific velocity at an instant time. There is no collision between atoms and velocity of the atom does not change until it hits the boundary, which reverses the velocity. Atoms in Lennard Jones solid and liquid collide and thus are different from harmonic oscillator VACF.&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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543106</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543106"/>
		<updated>2016-02-25T20:09:22Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure) and time (timestep x 0.002) (Figure). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for vapour &amp;gt; liquid &amp;gt; solid is expected and this is the case observed in both simulated and one million atom results (Table). The results in the table above also shown agreement between simulated and much larger system results. MSD models the displacement of an atom in a finite volume. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; for solids are very small as atoms are arranged regularly and closely packed, atoms have minimal or no movement. The change in MSD is due to atoms vibrating on its lattice site and as atoms vibrate, neighbouring atoms will be affected via intermolecular interactions and spread vibrational energy through the lattice structure. This explains why the MSD fluctuates throughout the simulated time frame. In liquid, atoms are arranged randomly and there are more spaces in between compared to solid state. Atomic motions like Brownian motion allows continuous collision between atoms and give rise to diffusive behaviour in liquid. Liquid has greater displacement of atoms compared to solid and thus a larger &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed. In vapour, atoms are far apart with lots of spacing in between and there is not much intermolecular interactions. Atoms are free to travel in the simulation box  and after a collision, there will be a much greater displacement and thus the largest &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is observed&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
Substitute the result obtained into the VACF,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543075</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543075"/>
		<updated>2016-02-25T19:46:26Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For all three phases, solid, liquid and vapour, the total MSD is plotted against timestep (Figure) and time (timestep x 0.002) (Figure). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line for Total MSD against time for each phases are then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Diffusion coefficient, &amp;lt;math&amp;gt; D = \frac {1}{6} \times gradient &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
Substitute the result obtained into the VACF,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543067</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543067"/>
		<updated>2016-02-25T19:37:55Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
Total MSD is plotted against time (timestep x 0.002). The gradient of the linear behaviour is found by using Excel trendline option. The gradient of the linear line is then used to find the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&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 result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Units of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is distance squared/ unit time.&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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
Substitute the result obtained into the VACF,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543058</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543058"/>
		<updated>2016-02-25T19:30:35Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Calculating heat capacities using statistical physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases. The point at &amp;lt;math&amp;gt; T^* = 2.4 &amp;lt;/math&amp;gt; is an anomaly which might be because of Brownian motion of the liquid.&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
Substitute the result obtained into the VACF,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543045</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543045"/>
		<updated>2016-02-25T19:21:59Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Calculating heat capacities using statistical physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is a physical property and is related to how easy it is to excite the system to a higher energy state. The trend shown in Figure is the one expected when &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; plotted against temperature. As temperature increases, heat capacity decreases for both densities. This is due to an increase in temperature causes atoms to have more kinetic energy and thus a greater proportion of atoms are populated to a higher energy state. Energy levels at higher state are closer together and have a smaller separation; therefore less energy is required to promote another atom at higher energy level. Since the volume is constant at &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and 0.8 and heat capacity decreases, overall, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; decreases.&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
Substitute the result obtained into the VACF,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543041</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543041"/>
		<updated>2016-02-25T19:20:18Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Running simulations under specific conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|350px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
Substitute the result obtained into the VACF,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543028</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543028"/>
		<updated>2016-02-25T19:03:01Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|1000px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated result || &amp;lt;math&amp;gt;5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5*10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
Substitute the result obtained into the VACF,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543026</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543026"/>
		<updated>2016-02-25T19:01:25Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|1000px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt; make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;D from MSD&#039;&#039;&#039; !! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
| Simulated result || &amp;lt;math&amp;gt;5x10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0968 &amp;lt;/math&amp;gt;||&amp;lt;math&amp;gt; 2.80 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 Million Atom result || &amp;lt;math&amp;gt; 5x10^{-6} &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 0.0873 &amp;lt;/math&amp;gt;|| &amp;lt;math&amp;gt; 2.54 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt; In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
Substitute the result obtained into the VACF,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543018</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=543018"/>
		<updated>2016-02-25T18:55:24Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|1000px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
Substitute the result obtained into the VACF,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&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}&lt;br /&gt;
&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=542761</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=542761"/>
		<updated>2016-02-25T16:55:21Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|1000px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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!). Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position of an atom following the classical harmonic oscillator equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate to get the velocity of the atom.&lt;br /&gt;
&lt;br /&gt;
&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;
Substitute the result obtained into the VACF,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+\phi))(-A\omega\sin(\omega(t+\tau)+\phi))\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega\sin(\omega t+ \phi))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; A^{2} &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega^{2} &amp;lt;/math&amp;gt; are taken out and cancelled&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+\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;&lt;br /&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;
Using the following trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(A+B)=\sin(A)\cos(B)+\cos(A)\sin(B)&amp;lt;/math&amp;gt;&amp;lt;/center&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;
&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;
sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function. &lt;br /&gt;
&lt;br /&gt;
The integral of an odd function within symmetrical limits equal 0:&lt;br /&gt;
&lt;br /&gt;
&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+\theta)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=541881</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=541881"/>
		<updated>2016-02-25T14:54:52Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Running simulations under specific conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|1000px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=541833</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=541833"/>
		<updated>2016-02-25T14:47:35Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Running simulations under specific conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
The ideal gas law equation was shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; PV = Nk_BT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since we are working in reduced units in the simulation, &amp;lt;math&amp;gt;k_B=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {P}{T} = \frac {N}{V} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density was found by pressure divided by temperature and substituting corresponding results obtained from simulations.&lt;br /&gt;
&lt;br /&gt;
Both the simulated density and ideal gas law density are plotted against temperature at two different pressures (2.5, 2.7) in Figure. Both results showed that as pressure increases, the density increases. The simulated density is lower than the ideal gas law density. This is because ideal gas law density uses kinetic theory and an assumption of any interaction between particles is zero is made. This means that particles are tightly packed together and thus the density of ideal gas law is always higher. In the case of simulated density, the atoms are Lennard Jones particles, when the atoms are too close together, there will be strong repulsion between the atoms and cause the atoms to be further apart and thus lower density. Both simulated and ideal gas law results showed that as the temperature increases, the density decreases. This is because as temperature increases, atoms gain more kinetic energy and move away from the equilibrium position. At higher pressure, the density is always higher and this is caused by at high pressure, the atoms are forced to be closer together and thus result in a higher density. Error bars in both x and y direction obtained from simulation were included. However, the error bars in y direction are too small to be seen clearly. It is shown that as the temperature increases, the size of the error bar increases. This was suggested to be due to an increase in temperature causes the temperature to fluctuate more and therefore introduce a greater error during measurements. The discrepancy between simulated and ideal gas law densities increases with pressure. As pressure increases, the atoms are closer together and there will be more interaction between them and thus behave less like an ideal gas, which give rise to larger discrepancy. &lt;br /&gt;
&lt;br /&gt;
A more sophisticated way to predict the density as temperature increases is to use the van der Waals equation shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left(P + \frac{an^2}{v^2}\right)\left(V-nb\right) = nRT \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike ideal gas law, the van der Waals equation takes into account attractive forces between atoms by including the correction term &amp;lt;math&amp;gt;\frac{an^2}{v^2}&amp;lt;/math&amp;gt; and van der Waals coefficient  &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; which depends on the type of atoms. The larger the attractive forces, the larger the coefficient &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|1000px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540539</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540539"/>
		<updated>2016-02-23T18:03:43Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Calculating heat capacities using statistical physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|1000px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
A system at equilibrium by melting a crystal was prepared. 10 simulations including two different densities (0.2 and 0.8) and temperature range of 2.0 to 2.8 were run in the NVT ensemble.&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540526</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540526"/>
		<updated>2016-02-23T17:52:31Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Calculating heat capacities using statistical physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|1000px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540484</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540484"/>
		<updated>2016-02-23T17:16:05Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Running simulations under specific conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Density vs Temp at different Pressure.PNG|thumb|1000px|Figure 10. Density vs Temp at different Pressure]]&amp;lt;/center&amp;gt;&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540483</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540483"/>
		<updated>2016-02-23T17:14:48Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Running simulations under specific conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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 at different Pressure.PNG|thumb|1000px|Figure 10. Density vs Temp at different Pressure]]&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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540466</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540466"/>
		<updated>2016-02-23T17:11:20Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185 (Figure 6). This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Figure 7) and Pressure vs Time (Figure 8). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs Time.PNG|thumb|350px|Figure 6. Total energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Temperature vs time.PNG|thumb|350px|Figure 7. Temperature vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Pressure vs Time.PNG|thumb|350px|Figure 8. Pressure vs Time]]&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Figure 9. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time at different timestep.PNG|thumb|450px|Figure 9. Total energy vs time at different timestep]]&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540449</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540449"/>
		<updated>2016-02-23T17:06:10Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below (Figure 2):&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time.PNG|thumb|350px|Figure 2. Energy vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs Time.PNG|thumb|350px|Figure 3. Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Figure 4) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Figure 4). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima between classical and velocity-Verlet solution against time.PNG|thumb|500px|Figure 4. Maxima between classical and velocity-Verlet solution against time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Figure 5). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time at different timestep.PNG|thumb|450px|Figure 5. Energy vs time at different timestep]]&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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185. This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Fig) and Pressure vs Time (Fig). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Fig. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540421</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540421"/>
		<updated>2016-02-23T16:52:43Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below (Figure 1):&lt;br /&gt;
&lt;br /&gt;
[[File:Position vs Time.PNG|thumb|350px|Figure 1. Position vs Time]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Fig) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Fig). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Fig). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185. This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Fig) and Pressure vs Time (Fig). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Fig. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540285</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540285"/>
		<updated>2016-02-23T15:24:39Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Fig) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Fig). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Fig). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After t=0.37, the energy remains fairly stable and mainly fluctuates between -3.183 and -3.185. This happens when the simulation reaches equilibrium. Similar results were observed in Temperature vs Time (Fig) and Pressure vs Time (Fig). Both temperature and pressure fluctuate within a small range after t=0.37.&lt;br /&gt;
&lt;br /&gt;
A plot showing energy versus time for 5 different timesteps was shown in Fig. Timestep = 0.0025 is the largest to give acceptable results. Timestep = 0.001 is the one with shortest timestep and therefore the most accurate results of the simulation. However, short timesteps mean that the same number of simulation steps cover a shorter amount of actual time and is very unhelpful when observation over a long time is needed. Similar results were obtained for timestep = 0.0025 which means that the data obtained using this timestep is still acceptable. Moreover, using timestep = 0.0025 require less processing power compared to timestep = 0.001. Timestep = 0.0075 and 0.001 also reaches equilibrium, however, the average energy value was higher and fluctuates more than the ones obtained with timestep = 0.001 and 0.0025.&lt;br /&gt;
&lt;br /&gt;
Timestep = 0.015 is a particularly bad choice as it is the one with largest timestep and the only one that does not give similar result as the other four choices. The simulation with timestep = 0.015 does not reach equilibrium. Instead, the total energy increases linearly while fluctuating. The result shows that at such large interval of measurement, the total energy increases over time. At large timestep, significant errors in the simulation was observed. This was due to two neighbouring atoms being too close together when timestep = 0.015 and thus experience significant repulsive force leading to the unstabilised and deviated result. The graph of timestep = 0.015 also shows that error in the simulation accumulates over time, resulting in an increase in the deviation of total energy from the other four choices of timestep over time.&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540188</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540188"/>
		<updated>2016-02-23T14:00:24Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy= Kinetic Energy + Potential Energy &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Total Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Fig) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Fig). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Fig). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540161</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540161"/>
		<updated>2016-02-23T13:34:39Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Energy= KE + PE &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Fig) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Fig). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Fig). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540160</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540160"/>
		<updated>2016-02-23T13:34:22Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Energy= KE + PE &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Energy=\frac{1}{2}\ m_i{v_i}^2 + \frac{1}{2}\ k_i{x_i}^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Fig) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Fig). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Fig). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540149</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540149"/>
		<updated>2016-02-23T13:31:14Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;KE=\frac{1}{2}\ m_i{v_i}^2 \ + \frac{1}{2}\ k_i{x_i}^2 \&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Fig) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Fig). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Fig). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540147</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540147"/>
		<updated>2016-02-23T13:29:11Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;KE=\frac{1}{2}\ m_i{v_i}^2 \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Fig) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Fig). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Fig). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540141</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540141"/>
		<updated>2016-02-23T13:22:38Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&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;
&#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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;KE=\frac{1}{2}\ m_i{v_i}^2 \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Fig) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Fig). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Fig). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540033</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540033"/>
		<updated>2016-02-23T11:44:42Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt; Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;KE=\frac{1}{2}\ m_i{v_i}^2 \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Fig) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Fig). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Different values of timestep was examined and the total energy was monitored. It was found that timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this simulation (Fig). As the timestep increases, the number of error increases and the magnitude of total energy changes significantly. Increasing the timestep increases the time interval between detection and therefore a larger difference in energy change was observed. &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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540014</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540014"/>
		<updated>2016-02-23T00:27:58Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt; Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;KE=\frac{1}{2}\ m_i{v_i}^2 \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Fig) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Fig). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Timestep less than or equal to 0.2 is needed to ensure the total energy does not change by more than 1% over the course of this 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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540012</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540012"/>
		<updated>2016-02-23T00:21:57Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt; Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;KE=\frac{1}{2}\ m_i{v_i}^2 \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Fig) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Fig). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540011</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540011"/>
		<updated>2016-02-23T00:21:06Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt; Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;KE=\frac{1}{2}\ m_i{v_i}^2 \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows that error increases as time increases. From time to time, the error reaches a maximum point and fall back to zero. This repeats continuously. Maxima occurs when the simulated and velocity-Verlet solutions oscillate at the same time.&lt;br /&gt;
&lt;br /&gt;
Maxima from the plot of &amp;quot;ERROR&amp;quot; against time (Fig) were found accurately using &amp;quot;Conditional Formatting&amp;quot; in Excel. The positions of the maxima are plotted as a function of time (Fig). The figure showed that the maximum of error increases as time increases with a linear relationship. The equation of the straight line was found to be &amp;lt;math&amp;gt; y=0.0004x - 7\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540008</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=540008"/>
		<updated>2016-02-23T00:00:22Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt; Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;KE=\frac{1}{2}\ m_i{v_i}^2 \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Time !! Maxima&lt;br /&gt;
|-&lt;br /&gt;
|2.0 || 7.58E-004&lt;br /&gt;
|-&lt;br /&gt;
|4.9 || 2.01E-003&lt;br /&gt;
|-&lt;br /&gt;
|8.0 || 3.30E-003&lt;br /&gt;
|-&lt;br /&gt;
|11.1 || 4.60E-003&lt;br /&gt;
|-&lt;br /&gt;
|14.2 || 5.91E-003&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539986</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539986"/>
		<updated>2016-02-22T23:27:53Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Introduction to molecular dynamics simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt; Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;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;
Following the classical harmonic oscillator equation above, the positions of atoms can be calculated (in the column &amp;quot;ANALYTICAL&amp;quot;) by the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\omega = 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi = 0.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ERROR&amp;quot; is always positive as it is the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;ENERGY&amp;quot; was calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;KE=\frac{1}{2}\ m_i{v_i}^2 \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m= 1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&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;
&#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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539966</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539966"/>
		<updated>2016-02-22T22:45:31Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt; Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 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;
&#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;
&#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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively. Distance from nearest atom: first layer &amp;lt; second layer &amp;lt; third layer. In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539963</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539963"/>
		<updated>2016-02-22T22:42:59Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt; Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 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;
&#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;
&#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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively.In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; equals 0 to 2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539888</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539888"/>
		<updated>2016-02-22T18:03:35Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt; Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 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;
&#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;
&#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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively.In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&lt;br /&gt;
&lt;br /&gt;
Fig below shows &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; of solid with &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; = 0-2. It can be used to verify the coordination number for each of the first 3 peaks.&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539861</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539861"/>
		<updated>2016-02-22T17:30:20Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt; Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 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;
&#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;
&#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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively.In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Coordination Number !! Distance (in reduced units) !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|Nearest neighbour || 12 || 0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|Second nearest neighbour || 6 || 1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|Neighbour || 24 || 1.725 || 1.408&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Average lattice spacing = (1.379 + 1.425 + 1.408)/3 = 1.404 in reduced units&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539848</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539848"/>
		<updated>2016-02-22T17:23:28Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt; Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 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;
&#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;
&#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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively.In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Distance !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|1.725 || 1.408&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539845</id>
		<title>Rep:Mod:mym113</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:mym113&amp;diff=539845"/>
		<updated>2016-02-22T17:22:50Z</updated>

		<summary type="html">&lt;p&gt;Mym113: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt; Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 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;
&#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;
&#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;
At &amp;lt;math&amp;gt; r = r_{0} &amp;lt;/math&amp;gt;, potential energy = 0&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; 0 = \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^6}{r_{0}^6}= \frac{\sigma^{12}}{r_{0}^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}^{6}= \sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4.2&amp;lt;/big&amp;gt; What is the force at this separation?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differentiate the &amp;lt;math&amp;gt;\phi\left(r_{0}\right)&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} = - \frac{\phi\left(r_{0}\right)}{\mathrm{d}\mathbf{r}} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{0}^{13}} + \frac{6\sigma^6}{r_{0}^{7}}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To obtain the force, substitute &amp;lt;math&amp;gt;r_{0}= \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12}{\sigma} + \frac{6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4\epsilon\left(\frac{-6}{\sigma}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&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;).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}U}{\mathrm{d}\mathbf{r}} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibrium separation is when the force is at minimum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - 4 \epsilon\left(-\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^{7}}\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{-12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^6}{r_{eq}^7} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}^{6} = 2\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_{eq} = 2^{1/6}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1}{4} - \frac{1}{2}\right) = - \epsilon &amp;lt;/math&amp;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.1&amp;lt;/big&amp;gt; Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt; 1 \ g \ cm^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL of water = &amp;lt;math&amp;gt; 1 \ g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of moles of water molecule in 1 mL of water = &amp;lt;math&amp;gt; \frac{mass}{M_{r}} = \frac{1}{18} = 0.0556 \ mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No. of water molecules in 1 mL of water = &amp;lt;math&amp;gt; mol\times N_{A} = 3.34\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5.2&amp;lt;/big&amp;gt; Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = \frac{10000}{3.34\times 10^{22}} = 2.99\times 10^{-19} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt; Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom ends up at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt; which is outside of a 1 unit cubic box. After the periodic boundary conditions have been applied, the atom ends up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; as one of its replicas enters the box through the opposite face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt; The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^*\times \sigma = 3.2 \times 0.34 = 1.09 \ nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
The well depth (&amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt;)&amp;lt;math&amp;gt;  = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = k_{B}\times 120 = 1.66\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-21} J = -1.66\times 10^{-24} kJ &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -1.66\times 10^{-24}\times N_{A} = -0.998 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^*\times \epsilon}{k_{B}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 1.5\times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = 180 \ K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==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;
If two atoms happened to be generated too close together, there will be repulsion between the electrons in the orbital. The two atoms will be pushed apart with a constant distance between. This situation is similar to atoms in solid state, where atoms are arranged in a regular way and has  long range order. If two atoms happened to be generated far apart, the arrangement of atoms will be similar to a gas. In liquid state, atoms are close together and arranged in a random way, therefore the starting coordinates of the atoms need to be specified to make sure the simulation is simulating atoms in liquid state.&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;center&amp;gt;&amp;lt;math&amp;gt; Number\ density = \frac{Number \ of \ lattice \ point}{Volume \ of  \ unit \ cell} = \frac{Number \ of \ lattice \ point}{Length^3} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For simple cubic lattice, number of lattice point = &amp;lt;math&amp;gt;  1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Number\ density = \frac{1}{1.0072^{3}} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For face-centred cubic lattice, number of lattice points = &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt;, assume length = &amp;lt;math&amp;gt;a&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^{3} = \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; a = 1.494 \ in \ reduced \ units &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In one unit of a face-centred cubic lattice, each atom at the corner contributes 1/8 to the unit cell and each atom on the face contributes 1/2 to the unit cell. This gives a total of 4 atoms per unit cell (8 x 1/8 + 6 x 1/2 = 4).&lt;br /&gt;
&lt;br /&gt;
Since there are 1000 unit cells, there will be 4000 atoms (1000 x 4 = 4000) created by the create_atoms command.&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;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of atoms. The number 1 between &amp;quot;mass&amp;quot; and &amp;quot;1.0&amp;quot; indicates that the simulation will contain only one type of atom. All atoms are identical and have a mass of 1.0 in reduced unit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the potential between the particles. &amp;quot;lj&amp;quot; means that only Lennard Jones Potential is considered. &amp;quot;3.0&amp;quot; is the distance units between two particles. &amp;quot;cut 3.0&amp;quot; means that any interactions between particles that are more than 3 distance units apart will be negligible and the potential will equal to zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This command determines the force field coefficient. The two numbers are the two parameters in the Lennard Jones Potential. The former &amp;quot;1.0&amp;quot; stands for the well depth (&amp;lt;math&amp;gt; \epsilon &amp;lt;/math&amp;gt;), the attraction between two atoms, and the latter &amp;quot;1.0&amp;quot; stands for the distance at which the potential between two atoms is zero (&amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt; Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm as shown 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;
The velocity-Verlet algorithm is a modified version of Verlet&#039;s algorithm which takes velocity into account and can be used to calculate the kinetic energy of the system.&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&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In both cases, the output values will be the same. However, the first method shown allows the timestep to be varied for different simulations in a much quicker way. By adding the second line, any variables that depend on the timestep value will change accordingly when the timestep value changes instead of changing the value manually line by line. The can reduce the probability of making mistakes in simulations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
! Pressure&lt;br /&gt;
! Timestep&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.5&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.6&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 1.9&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.2&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.5&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
| 2.8&lt;br /&gt;
| 2.7&lt;br /&gt;
| 0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK16&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;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&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;
Rearrange equation (2):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2  \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From equation (1):&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;
Substitute equation (1) into equation (2) and rearrange to obtain &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \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 values (100 1000 100000) specified are used to find the final average. The first value (100) represents Nevery and means use input values every this many timesteps. In this case, every 100 timesteps. The second value (1000) represents Nrepeat and means number of times to use input values for calculating averages. In this case, 1000. The third value (100000) stands for Nfreq which means calculate averages every this many timesteps.&lt;br /&gt;
&lt;br /&gt;
The values of temperature, etc., will be sampled every 100000 timesteps for the average. Input values are used every 100 timesteps and therefore 1000 measurements contribute to the average.&lt;br /&gt;
&lt;br /&gt;
The time stimulated will be dependent on the timestep chosen which will be 0.0025 in this simulation.&lt;br /&gt;
&lt;br /&gt;
0.0025 x 100000 = 250 time in reduced units&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;
==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;
Heat capacity can be calculated using the equation below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example input script for the simulation of &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt; = 0.2 and &amp;lt;math&amp;gt; T^* = 2.0 &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix npt all npt temp ${T} ${T} ${tdamp} iso ${p} ${p} ${pdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
###Switch off the thermostat with the commands###&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;
fix aves all ave/time 100 1000 100000 v_dens v_dens2 v_temp v_temp2 v_press v_press2 v_etotal v_etotal2 &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avepress equal f_aves[5]&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable Cv equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(f_aves[3]*f_aves[3])&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;
&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;
Conditions for the Lennard-Jones system.&lt;br /&gt;
&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.4 || 1.4&lt;br /&gt;
|-&lt;br /&gt;
|Liquid || 1.3 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas || 1.3 || 0.05&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function shows how density changes as a function of interatomic separation, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;. It gives the probability of finding an atom in the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; from another atom.&lt;br /&gt;
&lt;br /&gt;
Looking at Fig., all three RDFs show three typical features:&lt;br /&gt;
&lt;br /&gt;
# When &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;  is small, the RDF is zero. This is due to strong repulsive force between the two positively charged nuclei and negatively charged electron clouds.&lt;br /&gt;
# Obvious peaks were shown, indicating the chance of finding a pair of atom at a particular distance.&lt;br /&gt;
# At long distances, the RDFs approach 1 as the overall density is equal to the local density.&lt;br /&gt;
&lt;br /&gt;
The RDF of solid has the most number of peaks whereas the RDF of vapour only has one peak. The RDF of liquid is intermediate between solid and vapour, with a small number of peaks compared to the RDF of solid. &lt;br /&gt;
&lt;br /&gt;
Atoms in solid are close together and are arranged in a regular way with regular spacing. Neighbouring atoms are found at a specific distance as indicated by the peaks in the RDF. Since atoms are close together in solid, there is a greater probability of finding a neighbouring atom compared to liquid and vapour, where atoms are further apart, and thus there are more peaks observed in RDF.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid are close together, but arranged in a random way with irregular spacing. The RDF of liquid is intermediate between solid and vapour. It has much less peak than solid RDF, but more peaks than vapour RDF. The 4 distinct peaks showed that these are the 4 distances that are of favourable separation from another atom. Since atoms are less closer together compared to solid and have a lower probability of finding a neighbouring atom, the number of peaks observed decreases.&lt;br /&gt;
&lt;br /&gt;
For vapour, only one peak was observed and the RDF is very smooth compared to the other two. This is because atoms in vapour are far apart and are arranged in a random way. The short range order disappears completely.&lt;br /&gt;
&lt;br /&gt;
The face center cubic lattice structure has 4 lattice points are all in the same environment. The &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; for the first three peaks of the solid RDF are 0.975, 1.425 and 1.725. These represents the three nearest atoms respectively.In the first layer, there are 12 neighbours with distance 0.975 (nearest neighbour) (Fig). In the second layer, there are 6 neighbours with distance 1.425 (second nearest neighbour) (Fig). In the third layer, there are 24 neighbours with distance 1.725 (Fig). The lattice spacing between the atom and its neighbour are calculated using Pythagoras theorem.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Distance !! Lattice spacing&lt;br /&gt;
|-&lt;br /&gt;
|0.975 || 1.379&lt;br /&gt;
|-&lt;br /&gt;
|1.425 || 1.425&lt;br /&gt;
|-&lt;br /&gt;
|1.725 || 1.408&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;
&#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;
&#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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#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;/div&gt;</summary>
		<author><name>Mym113</name></author>
	</entry>
</feed>