<?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=Dl912</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=Dl912"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Dl912"/>
	<updated>2026-04-12T10:04: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:NTH0510&amp;diff=553025</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=553025"/>
		<updated>2016-03-10T23:07:37Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 8 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 atoms are given randomly at starting coordinates, two atoms got the chance to remain at the same position or approach each other which is unlikely to happen. There will be strong repulsion between two atoms if they are generated close together originally.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====TASK 21====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by the equation shows below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
D can be calculated by &amp;lt;math&amp;gt;D = \frac{1}{6}\times&amp;lt;/math&amp;gt;gradient of MSD as a function of time.&lt;br /&gt;
&lt;br /&gt;
[[File:Msd sol.png|700px|left|thumb|Figure.18 MSD VS Timesteps for Solid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd liq.png|700px|left|thumb|thumb|Figure.17 MSD VS Timesteps for Liquid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd vap.png|700px|left|thumb|Figure.19 MSD VS Timesteps for Vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (timestep)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (time)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||5.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||1.00E-03||5.09E-01||8.49E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||1.00E-03||5.24E-01||8.73E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.70E-02||1.03E+01||1.72E+00&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||3.05E-02||1.52E+01||2.54E+00&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot of MSD vs Timestep shows trends as expected. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;solid &#039;&#039;&#039; (Figure 17), MSD shows small fluctuations over the simulation, this is due to atoms in solid are well packed, and they only vibrate within small distance, therefore, the resultant diffusion coefficient is quite small (5.00E-06). &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;liquid&#039;&#039;&#039; (Figure 18), the MDS increase linearly over time, implying a greater freedom of freedom for liquid in contrast to solid. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;gas&#039;&#039;&#039;(Figure 19), atoms in vapour have the greatest degree of freedom to move. It ca be seen from the plot that there is a rapid increase at the beginning of simulation. The high freedom of movement is resulting in greater diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
====TASK 22====&lt;br /&gt;
&#039;&#039;&#039;TASK&#039;&#039;&#039;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;position&#039;&#039;&#039; of a 1D 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; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also, the velocity is &amp;lt;math&amp;gt; v\left(t\right)=\frac{x(t)} {dt} = - A\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))(-Aw\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin((wt+w\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(a+b)=\sin(a)\cos(b)+\cos(a)\sin(b)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)[\sin(wt+\theta)cos(w\tau)+\cos(wt+\theta)\sin(w\tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\cos(w\tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(wt+\theta)cos(wt+\theta)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\cos(w\tau)\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}+\frac{\sin(w\tau)\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(wt+\theta)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(wt+\theta)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(wt+\theta)\cos(wt+\theta)&amp;lt;/math&amp;gt; is consequently to be an odd function.&lt;br /&gt;
&lt;br /&gt;
Hence &amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;C(\tau)=\cos(w\tau)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:V overall.png|700px|left|thumb|thumb|Figure. 20 Velocity Autocorrelation Function for Solid and Liquid with C(t)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs plot of liquid and solid phase  indicating the change of directions of movement. &lt;br /&gt;
&lt;br /&gt;
In solid phase, the the change of direction is due to the vibrations of the atoms; however, in the liquid phase, the change is because to collisions of the atoms with each other. As can be seen from Figure.20, VACF decays as time goes by, this observation is due to the velocity decorrelates with time. In other words, the atom &#039;forget&#039; its initial velocity.&lt;br /&gt;
&lt;br /&gt;
In solid state, all atoms are well and closely pakced, therefore, the position of atoms in solid state is relatively fixed. Vibration is the only motion of solid atom. Atoms oscillates forwards and backwards and the velocities are reserved. This can be revealed from Figure. 20, showing that VACF oscillates strongly from positive to negative and so on. The decay of VACF is also associated with other factors.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid state have similar behaviors as in solid state, except they can move freely and collide to each other. Therefore, VACF of atoms decay more rapidly in liquid state. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. The harmonic oscillator is assuming there is only one atom in the system and the atom moving forwards and backwards and has no interaction with others, meaning that,there is no energy transfer and energy is constant over time. Hence, the magnitudes of velocity remains constant and only signs change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 23====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D 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;
Since diffusion coefficient can be obtained by integrating this function&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\times&amp;lt;/math&amp;gt;running integral as a function of time.&lt;br /&gt;
&lt;br /&gt;
Trapezium rule was employed to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The estimated integral and D are shown on the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! | &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! | &#039;&#039;&#039;Running integral (time)&#039;&#039;&#039;&lt;br /&gt;
!  | &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.73E-04||2.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||-8.33E-04||-2.78E-04&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||2.38E-01||7.94E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||2.47E-01||8.25E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.50E+00||8.34E-01&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||2.93E+00||9.78E-01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient increase from solid to gas due various degree of freedom. The estimated D from VACF have the same trend as D which are obtained from MSD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= REFERENCE =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=553005</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=553005"/>
		<updated>2016-03-10T22:51:17Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 23 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====TASK 21====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by the equation shows below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
D can be calculated by &amp;lt;math&amp;gt;D = \frac{1}{6}\times&amp;lt;/math&amp;gt;gradient of MSD as a function of time.&lt;br /&gt;
&lt;br /&gt;
[[File:Msd sol.png|700px|left|thumb|Figure.18 MSD VS Timesteps for Solid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd liq.png|700px|left|thumb|thumb|Figure.17 MSD VS Timesteps for Liquid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd vap.png|700px|left|thumb|Figure.19 MSD VS Timesteps for Vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (timestep)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (time)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||5.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||1.00E-03||5.09E-01||8.49E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||1.00E-03||5.24E-01||8.73E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.70E-02||1.03E+01||1.72E+00&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||3.05E-02||1.52E+01||2.54E+00&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot of MSD vs Timestep shows trends as expected. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;solid &#039;&#039;&#039; (Figure 17), MSD shows small fluctuations over the simulation, this is due to atoms in solid are well packed, and they only vibrate within small distance, therefore, the resultant diffusion coefficient is quite small (5.00E-06). &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;liquid&#039;&#039;&#039; (Figure 18), the MDS increase linearly over time, implying a greater freedom of freedom for liquid in contrast to solid. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;gas&#039;&#039;&#039;(Figure 19), atoms in vapour have the greatest degree of freedom to move. It ca be seen from the plot that there is a rapid increase at the beginning of simulation. The high freedom of movement is resulting in greater diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
====TASK 22====&lt;br /&gt;
&#039;&#039;&#039;TASK&#039;&#039;&#039;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;position&#039;&#039;&#039; of a 1D 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; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also, the velocity is &amp;lt;math&amp;gt; v\left(t\right)=\frac{x(t)} {dt} = - A\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))(-Aw\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin((wt+w\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(a+b)=\sin(a)\cos(b)+\cos(a)\sin(b)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)[\sin(wt+\theta)cos(w\tau)+\cos(wt+\theta)\sin(w\tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\cos(w\tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(wt+\theta)cos(wt+\theta)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\cos(w\tau)\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}+\frac{\sin(w\tau)\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(wt+\theta)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(wt+\theta)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(wt+\theta)\cos(wt+\theta)&amp;lt;/math&amp;gt; is consequently to be an odd function.&lt;br /&gt;
&lt;br /&gt;
Hence &amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;C(\tau)=\cos(w\tau)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:V overall.png|700px|left|thumb|thumb|Figure. 20 Velocity Autocorrelation Function for Solid and Liquid with C(t)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs plot of liquid and solid phase  indicating the change of directions of movement. &lt;br /&gt;
&lt;br /&gt;
In solid phase, the the change of direction is due to the vibrations of the atoms; however, in the liquid phase, the change is because to collisions of the atoms with each other. As can be seen from Figure.20, VACF decays as time goes by, this observation is due to the velocity decorrelates with time. In other words, the atom &#039;forget&#039; its initial velocity.&lt;br /&gt;
&lt;br /&gt;
In solid state, all atoms are well and closely pakced, therefore, the position of atoms in solid state is relatively fixed. Vibration is the only motion of solid atom. Atoms oscillates forwards and backwards and the velocities are reserved. This can be revealed from Figure. 20, showing that VACF oscillates strongly from positive to negative and so on. The decay of VACF is also associated with other factors.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid state have similar behaviors as in solid state, except they can move freely and collide to each other. Therefore, VACF of atoms decay more rapidly in liquid state. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. The harmonic oscillator is assuming there is only one atom in the system and the atom moving forwards and backwards and has no interaction with others, meaning that,there is no energy transfer and energy is constant over time. Hence, the magnitudes of velocity remains constant and only signs change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 23====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D 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;
Since diffusion coefficient can be obtained by integrating this function&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\times&amp;lt;/math&amp;gt;running integral as a function of time.&lt;br /&gt;
&lt;br /&gt;
Trapezium rule was employed to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The estimated integral and D are shown on the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! | &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! | &#039;&#039;&#039;Running integral (time)&#039;&#039;&#039;&lt;br /&gt;
!  | &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.73E-04||2.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||-8.33E-04||-2.78E-04&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||2.38E-01||7.94E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||2.47E-01||8.25E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.50E+00||8.34E-01&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||2.93E+00||9.78E-01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient increase from solid to gas due various degree of freedom. The estimated D from VACF have the same trend as D which are obtained from MSD.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= REFERENCE =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552999</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552999"/>
		<updated>2016-03-10T22:44:34Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 23 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====TASK 21====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by the equation shows below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
D can be calculated by &amp;lt;math&amp;gt;D = \frac{1}{6}\times&amp;lt;/math&amp;gt;gradient of MSD as a function of time.&lt;br /&gt;
&lt;br /&gt;
[[File:Msd sol.png|700px|left|thumb|Figure.18 MSD VS Timesteps for Solid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd liq.png|700px|left|thumb|thumb|Figure.17 MSD VS Timesteps for Liquid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd vap.png|700px|left|thumb|Figure.19 MSD VS Timesteps for Vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (timestep)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (time)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||5.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||1.00E-03||5.09E-01||8.49E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||1.00E-03||5.24E-01||8.73E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.70E-02||1.03E+01||1.72E+00&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||3.05E-02||1.52E+01||2.54E+00&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot of MSD vs Timestep shows trends as expected. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;solid &#039;&#039;&#039; (Figure 17), MSD shows small fluctuations over the simulation, this is due to atoms in solid are well packed, and they only vibrate within small distance, therefore, the resultant diffusion coefficient is quite small (5.00E-06). &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;liquid&#039;&#039;&#039; (Figure 18), the MDS increase linearly over time, implying a greater freedom of freedom for liquid in contrast to solid. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;gas&#039;&#039;&#039;(Figure 19), atoms in vapour have the greatest degree of freedom to move. It ca be seen from the plot that there is a rapid increase at the beginning of simulation. The high freedom of movement is resulting in greater diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
====TASK 22====&lt;br /&gt;
&#039;&#039;&#039;TASK&#039;&#039;&#039;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;position&#039;&#039;&#039; of a 1D 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; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also, the velocity is &amp;lt;math&amp;gt; v\left(t\right)=\frac{x(t)} {dt} = - A\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))(-Aw\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin((wt+w\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(a+b)=\sin(a)\cos(b)+\cos(a)\sin(b)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)[\sin(wt+\theta)cos(w\tau)+\cos(wt+\theta)\sin(w\tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\cos(w\tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(wt+\theta)cos(wt+\theta)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\cos(w\tau)\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}+\frac{\sin(w\tau)\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(wt+\theta)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(wt+\theta)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(wt+\theta)\cos(wt+\theta)&amp;lt;/math&amp;gt; is consequently to be an odd function.&lt;br /&gt;
&lt;br /&gt;
Hence &amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;C(\tau)=\cos(w\tau)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:V overall.png|700px|left|thumb|thumb|Figure. 20 Velocity Autocorrelation Function for Solid and Liquid with C(t)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs plot of liquid and solid phase  indicating the change of directions of movement. &lt;br /&gt;
&lt;br /&gt;
In solid phase, the the change of direction is due to the vibrations of the atoms; however, in the liquid phase, the change is because to collisions of the atoms with each other. As can be seen from Figure.20, VACF decays as time goes by, this observation is due to the velocity decorrelates with time. In other words, the atom &#039;forget&#039; its initial velocity.&lt;br /&gt;
&lt;br /&gt;
In solid state, all atoms are well and closely pakced, therefore, the position of atoms in solid state is relatively fixed. Vibration is the only motion of solid atom. Atoms oscillates forwards and backwards and the velocities are reserved. This can be revealed from Figure. 20, showing that VACF oscillates strongly from positive to negative and so on. The decay of VACF is also associated with other factors.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid state have similar behaviors as in solid state, except they can move freely and collide to each other. Therefore, VACF of atoms decay more rapidly in liquid state. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. The harmonic oscillator is assuming there is only one atom in the system and the atom moving forwards and backwards and has no interaction with others, meaning that,there is no energy transfer and energy is constant over time. Hence, the magnitudes of velocity remains constant and only signs change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 23====&lt;br /&gt;
&#039;&#039;&#039;TASK: TASK: 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 D 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;
Since diffusion coefficient can be obtained by integrating this function&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\times&amp;lt;/math&amp;gt;running integral as a function of time.&lt;br /&gt;
&lt;br /&gt;
Trapezium rule was employed to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas. The estimated integral and D are shown on the table below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! | &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
! | &#039;&#039;&#039;Running integral (time)&#039;&#039;&#039;&lt;br /&gt;
!  | &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.73E-04||2.58E-04&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||-8.33E-04||-2.78E-04&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||2.38E-01||7.94E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||2.47E-01||8.25E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.50E+00||8.34E-01&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||2.93E+00||9.78E-01&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient increase from solid to gas due various degree of freedom. The estimated D from VACF have the same trend as D which are obtained from MSD.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552932</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552932"/>
		<updated>2016-03-10T21:11:45Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====TASK 21====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by the equation shows below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
D can be calculated by &amp;lt;math&amp;gt;D = \frac{1}{6}\times&amp;lt;/math&amp;gt;gradient of MSD as a function of time.&lt;br /&gt;
&lt;br /&gt;
[[File:Msd sol.png|700px|left|thumb|Figure.18 MSD VS Timesteps for Solid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd liq.png|700px|left|thumb|thumb|Figure.17 MSD VS Timesteps for Liquid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd vap.png|700px|left|thumb|Figure.19 MSD VS Timesteps for Vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (timestep)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (time)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||5.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||1.00E-03||5.09E-01||8.49E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||1.00E-03||5.24E-01||8.73E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.70E-02||1.03E+01||1.72E+00&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||3.05E-02||1.52E+01||2.54E+00&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot of MSD vs Timestep shows trends as expected. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;solid &#039;&#039;&#039; (Figure 17), MSD shows small fluctuations over the simulation, this is due to atoms in solid are well packed, and they only vibrate within small distance, therefore, the resultant diffusion coefficient is quite small (5.00E-06). &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;liquid&#039;&#039;&#039; (Figure 18), the MDS increase linearly over time, implying a greater freedom of freedom for liquid in contrast to solid. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;gas&#039;&#039;&#039;(Figure 19), atoms in vapour have the greatest degree of freedom to move. It ca be seen from the plot that there is a rapid increase at the beginning of simulation. The high freedom of movement is resulting in greater diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
====TASK 22====&lt;br /&gt;
&#039;&#039;&#039;TASK&#039;&#039;&#039;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;position&#039;&#039;&#039; of a 1D 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; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also, the velocity is &amp;lt;math&amp;gt; v\left(t\right)=\frac{x(t)} {dt} = - A\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))(-Aw\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin((wt+w\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(a+b)=\sin(a)\cos(b)+\cos(a)\sin(b)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)[\sin(wt+\theta)cos(w\tau)+\cos(wt+\theta)\sin(w\tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\cos(w\tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(wt+\theta)cos(wt+\theta)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\cos(w\tau)\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}+\frac{\sin(w\tau)\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(wt+\theta)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(wt+\theta)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(wt+\theta)\cos(wt+\theta)&amp;lt;/math&amp;gt; is consequently to be an odd function.&lt;br /&gt;
&lt;br /&gt;
Hence &amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;C(\tau)=\cos(w\tau)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:V overall.png|700px|left|thumb|thumb|Figure. 20 Velocity Autocorrelation Function for Solid and Liquid with C(t)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs plot of liquid and solid phase  indicating the change of directions of movement. &lt;br /&gt;
&lt;br /&gt;
In solid phase, the the change of direction is due to the vibrations of the atoms; however, in the liquid phase, the change is because to collisions of the atoms with each other. As can be seen from Figure.20, VACF decays as time goes by, this observation is due to the velocity decorrelates with time. In other words, the atom &#039;forget&#039; its initial velocity.&lt;br /&gt;
&lt;br /&gt;
In solid state, all atoms are well and closely pakced, therefore, the position of atoms in solid state is relatively fixed. Vibration is the only motion of solid atom. Atoms oscillates forwards and backwards and the velocities are reserved. This can be revealed from Figure. 20, showing that VACF oscillates strongly from positive to negative and so on. The decay of VACF is also associated with other factors.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid state have similar behaviors as in solid state, except they can move freely and collide to each other. Therefore, VACF of atoms decay more rapidly in liquid state. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. The harmonic oscillator is assuming there is only one atom in the system and the atom moving forwards and backwards and has no interaction with others, meaning that,there is no energy transfer and energy is constant over time. Hence, the magnitudes of velocity remains constant and only signs change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 23====&lt;br /&gt;
&#039;&#039;&#039;TASK: TASK: 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 D 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>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552929</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552929"/>
		<updated>2016-03-10T21:02:38Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 22 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====TASK 21====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by the equation shows below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
D can be calculated by &amp;lt;math&amp;gt;D = \frac{1}{6}\times&amp;lt;/math&amp;gt;gradient of MSD as a function of time.&lt;br /&gt;
&lt;br /&gt;
[[File:Msd sol.png|500px|left|thumb|Figure.18 MSD VS Timesteps for Solid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd liq.png|500px|left|thumb|thumb|Figure.17 MSD VS Timesteps for Liquid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd vap.png|500px|left|thumb|Figure.19 MSD VS Timesteps for Vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (timestep)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (time)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||5.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||1.00E-03||5.09E-01||8.49E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||1.00E-03||5.24E-01||8.73E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.70E-02||1.03E+01||1.72E+00&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||3.05E-02||1.52E+01||2.54E+00&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot of MSD vs Timestep shows trends as expected. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;solid &#039;&#039;&#039; (Figure 17), MSD shows small fluctuations over the simulation, this is due to atoms in solid are well packed, and they only vibrate within small distance, therefore, the resultant diffusion coefficient is quite small (5.00E-06). &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;liquid&#039;&#039;&#039; (Figure 18), the MDS increase linearly over time, implying a greater freedom of freedom for liquid in contrast to solid. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;gas&#039;&#039;&#039;(Figure 19), atoms in vapour have the greatest degree of freedom to move. It ca be seen from the plot that there is a rapid increase at the beginning of simulation. The high freedom of movement is resulting in greater diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
====TASK 22====&lt;br /&gt;
&#039;&#039;&#039;TASK&#039;&#039;&#039;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;position&#039;&#039;&#039; of a 1D 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; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also, the velocity is &amp;lt;math&amp;gt; v\left(t\right)=\frac{x(t)} {dt} = - A\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))(-Aw\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin((wt+w\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(a+b)=\sin(a)\cos(b)+\cos(a)\sin(b)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)[\sin(wt+\theta)cos(w\tau)+\cos(wt+\theta)\sin(w\tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\cos(w\tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(wt+\theta)cos(wt+\theta)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\cos(w\tau)\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}+\frac{\sin(w\tau)\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(wt+\theta)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(wt+\theta)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(wt+\theta)\cos(wt+\theta)&amp;lt;/math&amp;gt; is consequently to be an odd function.&lt;br /&gt;
&lt;br /&gt;
Hence &amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;C(\tau)=\cos(w\tau)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:V overall.png|500px|left|thumb|thumb|Figure. 20 Velocity Autocorrelation Function for Solid and Liquid with C(t)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs plot of liquid and solid phase  indicating the change of directions of movement. &lt;br /&gt;
&lt;br /&gt;
In solid phase, the the change of direction is due to the vibrations of the atoms; however, in the liquid phase, the change is because to collisions of the atoms with each other. As can be seen from Figure.20, VACF decays as time goes by, this observation is due to the velocity decorrelates with time. In other words, the atom &#039;forget&#039; its initial velocity.&lt;br /&gt;
&lt;br /&gt;
In solid state, all atoms are well and closely pakced, therefore, the position of atoms in solid state is relatively fixed. Vibration is the only motion of solid atom. Atoms oscillates forwards and backwards and the velocities are reserved. This can be revealed from Figure. 20, showing that VACF oscillates strongly from positive to negative and so on. The decay of VACF is also associated with other factors.&lt;br /&gt;
&lt;br /&gt;
Atoms in liquid state have similar behaviors as in solid state, except they can move freely and collide to each other. Therefore, VACF of atoms decay more rapidly in liquid state. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. The harmonic oscillator is assuming there is only one atom in the system and the atom moving forwards and backwards and has no interaction with others, meaning that,there is no energy transfer and energy is constant over time. Hence, the magnitudes of velocity remains constant and only signs change.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552825</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552825"/>
		<updated>2016-03-10T18:51:45Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 22 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====TASK 21====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by the equation shows below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
D can be calculated by &amp;lt;math&amp;gt;D = \frac{1}{6}\times&amp;lt;/math&amp;gt;gradient of MSD as a function of time.&lt;br /&gt;
&lt;br /&gt;
[[File:Msd sol.png|500px|left|thumb|Figure.18 MSD VS Timesteps for Solid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd liq.png|500px|left|thumb|thumb|Figure.17 MSD VS Timesteps for Liquid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd vap.png|500px|left|thumb|Figure.19 MSD VS Timesteps for Vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (timestep)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (time)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||5.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||1.00E-03||5.09E-01||8.49E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||1.00E-03||5.24E-01||8.73E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.70E-02||1.03E+01||1.72E+00&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||3.05E-02||1.52E+01||2.54E+00&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot of MSD vs Timestep shows trends as expected. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;solid &#039;&#039;&#039; (Figure 17), MSD shows small fluctuations over the simulation, this is due to atoms in solid are well packed, and they only vibrate within small distance, therefore, the resultant diffusion coefficient is quite small (5.00E-06). &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;liquid&#039;&#039;&#039; (Figure 18), the MDS increase linearly over time, implying a greater freedom of freedom for liquid in contrast to solid. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;gas&#039;&#039;&#039;(Figure 19), atoms in vapour have the greatest degree of freedom to move. It ca be seen from the plot that there is a rapid increase at the beginning of simulation. The high freedom of movement is resulting in greater diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
====TASK 22====&lt;br /&gt;
&#039;&#039;&#039;TASK&#039;&#039;&#039;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;position&#039;&#039;&#039; of a 1D 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; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also, the velocity is &amp;lt;math&amp;gt; v\left(t\right)=\frac{x(t)} {dt} = - A\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))(-Aw\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin((wt+w\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(a+b)=\sin(a)\cos(b)+\cos(a)\sin(b)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)[\sin(wt+\theta)cos(w\tau)+\cos(wt+\theta)\sin(w\tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\cos(w\tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(wt+\theta)cos(wt+\theta)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\cos(w\tau)\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}+\frac{\sin(w\tau)\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(wt+\theta)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(wt+\theta)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(wt+\theta)\cos(wt+\theta)&amp;lt;/math&amp;gt; is consequently to be an odd function.&lt;br /&gt;
&lt;br /&gt;
Hence &amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;C(\tau)=\cos(w\tau)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The minima of liquid and solid phase in the VACFs indicating the change of directions of movement. &lt;br /&gt;
&lt;br /&gt;
In solid phase, the the change of direction is due to the vibrations of the atoms;however, in the liquid phase, the change is because to collisions of the atoms with each other. The VACF will decay over a long range of time. This is because the velocity decorrelates with time, which means the atom &#039;forgets&#039; what its initial velocity was.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552817</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552817"/>
		<updated>2016-03-10T18:34:45Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====TASK 21====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by the equation shows below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
D can be calculated by &amp;lt;math&amp;gt;D = \frac{1}{6}\times&amp;lt;/math&amp;gt;gradient of MSD as a function of time.&lt;br /&gt;
&lt;br /&gt;
[[File:Msd sol.png|500px|left|thumb|Figure.18 MSD VS Timesteps for Solid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd liq.png|500px|left|thumb|thumb|Figure.17 MSD VS Timesteps for Liquid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd vap.png|500px|left|thumb|Figure.19 MSD VS Timesteps for Vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (timestep)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (time)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||5.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||1.00E-03||5.09E-01||8.49E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||1.00E-03||5.24E-01||8.73E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.70E-02||1.03E+01||1.72E+00&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||3.05E-02||1.52E+01||2.54E+00&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot of MSD vs Timestep shows trends as expected. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;solid &#039;&#039;&#039; (Figure 17), MSD shows small fluctuations over the simulation, this is due to atoms in solid are well packed, and they only vibrate within small distance, therefore, the resultant diffusion coefficient is quite small (5.00E-06). &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;liquid&#039;&#039;&#039; (Figure 18), the MDS increase linearly over time, implying a greater freedom of freedom for liquid in contrast to solid. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;gas&#039;&#039;&#039;(Figure 19), atoms in vapour have the greatest degree of freedom to move. It ca be seen from the plot that there is a rapid increase at the beginning of simulation. The high freedom of movement is resulting in greater diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
====TASK 22====&lt;br /&gt;
&#039;&#039;&#039;TASK&#039;&#039;&#039;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;position&#039;&#039;&#039; of a 1D 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; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also, the velocity is &amp;lt;math&amp;gt; v\left(t\right)=\frac{x(t)} {dt} = - A\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))(-Aw\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin((wt+w\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(a+b)=\sin(a)\cos(b)+\cos(a)\sin(b)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)[\sin(wt+\theta)cos(w\tau)+\cos(wt+\theta)\sin(w\tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\cos(w\tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(wt+\theta)cos(wt+\theta)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\cos(w\tau)\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}+\frac{\sin(w\tau)\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(wt+\theta)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(wt+\theta)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(wt+\theta)\cos(wt+\theta)&amp;lt;/math&amp;gt; is consequently to be an odd function.&lt;br /&gt;
&lt;br /&gt;
Hence &amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;C(\tau)=\cos(w\tau)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552813</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552813"/>
		<updated>2016-03-10T18:28:39Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====TASK 21====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by the equation shows below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
D can be calculated by &amp;lt;math&amp;gt;D = \frac{1}{6}\times&amp;lt;/math&amp;gt;gradient of MSD as a function of time.&lt;br /&gt;
&lt;br /&gt;
[[File:Msd sol.png|500px|left|thumb|Figure.18 MSD VS Timesteps for Solid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd liq.png|500px|left|thumb|thumb|Figure.17 MSD VS Timesteps for Liquid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd vap.png|500px|left|thumb|Figure.19 MSD VS Timesteps for Vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (timestep)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (time)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||5.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||1.00E-03||5.09E-01||8.49E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||1.00E-03||5.24E-01||8.73E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.70E-02||1.03E+01||1.72E+00&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||3.05E-02||1.52E+01||2.54E+00&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot of MSD vs Timestep shows trends as expected. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;solid &#039;&#039;&#039; (Figure 17), MSD shows small fluctuations over the simulation, this is due to atoms in solid are well packed, and they only vibrate within small distance, therefore, the resultant diffusion coefficient is quite small (5.00E-06). &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;liquid&#039;&#039;&#039; (Figure 18), the MDS increase linearly over time, implying a greater freedom of freedom for liquid in contrast to solid. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;gas&#039;&#039;&#039;(Figure 19), atoms in vapour have the greatest degree of freedom to move. It ca be seen from the plot that there is a rapid increase at the beginning of simulation. The high freedom of movement is resulting in greater diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
====TASK 22====&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;position&#039;&#039;&#039; of a 1D 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; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also, the velocity is &amp;lt;math&amp;gt; v\left(t\right)=\frac{x(t)} {dt} = - A\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))(-Aw\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}(-Aw\sin(wt+\theta))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin(w(t+\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)\sin((wt+w\tau)+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(a+b)=\sin(a)\cos(b)+\cos(a)\sin(b)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(wt+\theta)[\sin(wt+\theta)cos(w\tau)+\cos(wt+\theta)\sin(w\tau)]\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\cos(w\tau)\mathrm{d}t+\int_{-\infty}^{\infty}\sin(wt+\theta)cos(wt+\theta)\sin(w\tau) \mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\cos(w\tau)\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}+\frac{\sin(w\tau)\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t}{\int_{-\infty}^{\infty}\sin^2(wt+\theta)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(wt+\theta)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(wt+\theta)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(wt+\theta)\cos(wt+\theta)&amp;lt;/math&amp;gt; is consequently to be an odd function.&lt;br /&gt;
&lt;br /&gt;
Hence &amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\sin(wt+\theta)\cos(wt+\theta)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;C(\tau)=\cos(w\tau)&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552424</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552424"/>
		<updated>2016-03-10T15:43:28Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====TASK 21====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by the equation shows below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
D can be calculated by &amp;lt;math&amp;gt;D = \frac{1}{6}\times&amp;lt;/math&amp;gt;gradient of MSD as a function of time.&lt;br /&gt;
&lt;br /&gt;
[[File:Msd sol.png|500px|left|thumb|Figure.18 MSD VS Timesteps for Solid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd liq.png|500px|left|thumb|thumb|Figure.17 MSD VS Timesteps for Liquid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd vap.png|500px|left|thumb|Figure.19 MSD VS Timesteps for Vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (timestep)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (time)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||5.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||1.00E-03||5.09E-01||8.49E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||1.00E-03||5.24E-01||8.73E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.70E-02||1.03E+01||1.72E+00&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||3.05E-02||1.52E+01||2.54E+00&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot of MSD vs Timestep shows trends as expected. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;solid &#039;&#039;&#039; (Figure 17), MSD shows small fluctuations over the simulation, this is due to atoms in solid are well packed, and they only vibrate within small distance, therefore, the resultant diffusion coefficient is quite small (5.00E-06). &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;liquid&#039;&#039;&#039; (Figure 18), the MDS increase linearly over time, implying a greater freedom of freedom for liquid in contrast to solid. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;gas&#039;&#039;&#039;(Figure 19), atoms in vapour have the greatest degree of freedom to move. It ca be seen from the plot that there is a rapid increase at the beginning of simulation. The high freedom of movement is resulting in greater diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
====TASK 22====&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552185</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=552185"/>
		<updated>2016-03-10T15:08:16Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====TASK 21====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by the equation shows below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
D can be calculated by &amp;lt;math&amp;gt;D = \frac{1}{6}\times&amp;lt;/math&amp;gt;gradient of MSD as a function of time.&lt;br /&gt;
&lt;br /&gt;
[[File:Msd sol.png|500px|left|thumb|Figure.18 MSD VS Timesteps for Solid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd liq.png|500px|left|thumb|thumb|Figure.17 MSD VS Timesteps for Liquid.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Msd vap.png|500px|left|thumb|Figure.19 MSD VS Timesteps for Vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (timestep)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (time)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||5.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||1.00E-03||5.09E-01||8.49E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||1.00E-03||5.24E-01||8.73E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.70E-02||1.03E+01||1.72E+00&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||3.05E-02||1.52E+01||2.54E+00&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot of MSD vs Timestep shows trends as expected. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;solid &#039;&#039;&#039; (Figure 17), MSD shows small fluctuations over the simulation, this is due to atoms in solid are well packed, and they only vibrate within small distance, therefore, the resultant diffusion coefficient is quite small (5.00E-06). &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;liquid&#039;&#039;&#039; (Figure 18), the MDS increase linearly over time, implying a greater freedom of freedom for liquid in contrast to solid. &lt;br /&gt;
&lt;br /&gt;
*For &#039;&#039;&#039;gas&#039;&#039;&#039;(Figure 19), atoms in vapour have the greatest degree of freedom to move. It ca be seen from the plot that there is a rapid increase at the beginning of simulation. The high freedom of movement is resulting in greater diffusion coefficient.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=551997</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=551997"/>
		<updated>2016-03-10T14:32:54Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====TASK 21====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by the equation shows below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
D can be calculated by &amp;lt;math&amp;gt;D = \frac{1}{6}\times&amp;lt;/math&amp;gt;gradient of MSD as a function of time.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (timestep)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (time)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||5.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||1.00E-03||5.09E-01||8.49E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||1.00E-03||5.24E-01||8.73E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.70E-02||1.03E+01||1.72E+00&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||3.05E-02||1.52E+01||2.54E+00&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=551979</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=551979"/>
		<updated>2016-03-10T14:28:43Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====TASK 21====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by the equation shows below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
D can be calculated by &amp;lt;math&amp;gt;D = \frac{1}{6}\times&amp;lt;/math&amp;gt;gradient of MSD as a function of time.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (timestep)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Gradient (time)&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;D&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Solid (32000 atoms)||7.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Solid (1 million atoms)||5.00E-08||3.00E-05||5.00E-06&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (8000 atoms)||1.00E-03||5.09E-01||8.49E-02&lt;br /&gt;
|-&lt;br /&gt;
| Liquid (1 million atoms)||1.00E-03||5.24E-01||8.73E-02&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (8000 atoms)||2.70E-02||1.03E+01||1.72E+00&lt;br /&gt;
|-&lt;br /&gt;
| Vapour (1 million atoms)||3.05E-02||1.52E+01||2.54E+00&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=551616</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=551616"/>
		<updated>2016-03-10T12:28:42Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====TASK 21====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 D 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;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550997</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550997"/>
		<updated>2016-03-08T22:49:15Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 20_Simulations in this section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Liquid&#039;&#039;&#039; (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Vapour&#039;&#039;&#039; (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550996</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550996"/>
		<updated>2016-03-08T22:45:51Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*Liquid (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*Vapour (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|600px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550993</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550993"/>
		<updated>2016-03-08T22:40:15Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Structural properties and the radial distribution function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*Liquid (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*Vapour (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell1.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550991</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550991"/>
		<updated>2016-03-08T22:35:40Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Calculating Heat Capacities Using Statistical Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*Liquid (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*Vapour (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550990</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550990"/>
		<updated>2016-03-08T22:28:29Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 20_Simulations in this section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*Liquid (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*Vapour (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;br /&gt;
&lt;br /&gt;
[[File:Cubic unit cell.png|500px|left|thumb|thumb|Figure.15 fcc cubic unic cell]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In Figure. 15, atom a, b, and c are corresponding to the first 3 peak for solid state in Figure.13.&lt;br /&gt;
Reference atom is indicating in red.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom a is defined as A.&lt;br /&gt;
&lt;br /&gt;
The distance from reference atom to atom b is calculated to be   &amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The distance from reference atom to atom b is calculated to be &amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Distance can be confirmed by determing A from the three peaks and compare with the theoretical A value.&lt;br /&gt;
&lt;br /&gt;
* solid is possessed fcc lattice structure (Figure 15).  &lt;br /&gt;
The coordination number for &#039;&#039;&#039;atom a&#039;&#039;&#039; is 6.&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom b&#039;&#039;&#039; in a unit cell, and as reference atom is surranded by 8 unit cell---&amp;gt; &amp;lt;math&amp;gt;CN = \frac{3}{2}*8 = 12&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 3 equivalent &#039;&#039;&#039;atom c&#039;&#039;&#039; in a unit cell, unlike atom b, they do not share with unit cells ---&amp;gt; &amp;lt;math&amp;gt;CN =3*8 = 24&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The coordinatio number can be confirmed by the integral the area under g(r). In this case, as only focus in the first 3 peaks, the cure can be zoomed in into the region from r=0 to r=2 (see Figure. 16).&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| &#039;&#039;&#039;Atom&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Peak Distance&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Distance relatives to reference atom&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Determined A&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;Coordination Number&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| a||1.025||A||1.025||6&lt;br /&gt;
|-&lt;br /&gt;
| b||0.976||&amp;lt;math&amp;gt;\frac{1}{\sqrt{2}}A&amp;lt;/math&amp;gt;||1.381||12&lt;br /&gt;
|-&lt;br /&gt;
| c||1.675||&amp;lt;math&amp;gt;\sqrt{\frac{3}{2}}A&amp;lt;/math&amp;gt;||1.490||24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Zoomin.png|700px|left||thumb|Figure.16 Integral of g(r) VS distance for solid (r=0 to r=2)]]&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550960</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550960"/>
		<updated>2016-03-08T20:29:09Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 20_Simulations in this section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
[[File:G(r) VS distance.png|700px|left|thumb|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*Liquid (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*Vapour (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;br /&gt;
&lt;br /&gt;
[[File:Intedralgr.png|700px|left|thumb|Fig.14 Integral of g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fig. 14 shows the integral of g(r) as a function of distance, which is the area under g(r).&lt;br /&gt;
Solid has the highest probability to find a neighbour relative to the reference atom, resulting in the greater area under g(r) curve.&lt;br /&gt;
The area under g(r) for liquid is less then solid then followed by vapour, due to the degree of disorder.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550955</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550955"/>
		<updated>2016-03-08T20:18:50Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 20_Simulations in this section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapor are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapor: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
[[File:G(r) VS distance.png|thumb|Fig.13 g(r) VS distance for solid, liquid and vapour.]]&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapor . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;br /&gt;
&lt;br /&gt;
*Liquid (blue) phase has lower density than solid but higher than vapor. only 3 obvious peaks can be found on Figure.13 for liquid, as the atom separations are greater than solid, and also less ordered, meaning that reference atom in liquid phase is more difficult to find a neighbor.&lt;br /&gt;
&lt;br /&gt;
*Vapour (orange) phase has the lowest density as well as less ordered in contrast to other two phase. In Fig.13, only 1 peak can be observed, indicating the atom arrangement is highly disordered, and the probability that a reference atom to fin a neighbor is quite small.&lt;br /&gt;
&lt;br /&gt;
As the distance increase further, the average RDF tend to be 1, as at that stage, RDF is dominated by the average density of that system.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550885</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550885"/>
		<updated>2016-03-08T17:52:13Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 20_Simulations in this section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapour are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapour: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;br /&gt;
As can be seen form Figure. 13, the RDF is 0 when r is small (0.025-0.0825), as the atoms cannot approach to each other closely due to the present of repulsion.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solid&#039;&#039;&#039; (grey) phase has the highest density and the most ordered comparing to liquid and vapour . The fluctuation indicating atoms are closely packed together as the lattice structure is more ordered, therefore, shorter distance to find a neighbor atom.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550864</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550864"/>
		<updated>2016-03-08T16:59:55Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 20_Simulations in this section */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Densities and temperatures for solid, liquid and vapour are indicated below: &amp;lt;ref name=&amp;quot;hansen&amp;quot;&amp;gt;J. Hansen, L. Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151-161.{{DOI|10.1103/physrev.184.151}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid: density 1.25, temperature 1.35 fcc&lt;br /&gt;
&lt;br /&gt;
Vapour: density 0.08, temperature 1.15 sc&lt;br /&gt;
&lt;br /&gt;
Liquid: density 0.8, temperature 1.2 sc&lt;br /&gt;
&lt;br /&gt;
In statistical mechanics, Radial distribution function (RDF) describes the behavior of density  as a function of distance relative to reference particle.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550801</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550801"/>
		<updated>2016-03-08T15:50:12Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 19_Heat Capacity Calculation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===TASK 20_Simulations in this section===&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550779</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550779"/>
		<updated>2016-03-08T15:28:10Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 19_Heat Capacity Calculation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
&lt;br /&gt;
[[File:Cv vs V.png|700px|left|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550778</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550778"/>
		<updated>2016-03-08T15:25:37Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Calculating Heat Capacities Using Statistical Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;br /&gt;
[[File:Cv vs V.png|thumb|Figure.12 Heat  capacity per volume as the function of temperature under density=0.2 and 0.8.]]&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550750</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550750"/>
		<updated>2016-03-08T15:02:31Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 19_Heat Capacity Calculation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure.12 shows as the temperature increases, the heat capacity per volume decrease.&lt;br /&gt;
&lt;br /&gt;
Heat capaticy is a quantity which measures the amount of energy is required to raise the temperature of a system.&amp;lt;ref name=&amp;quot;Halliday&amp;quot;&amp;gt;D.Halliday, R.Resnick, &amp;quot;Fundamentals of Physics&amp;quot;, &#039;&#039;Wiley&#039;&#039;, &#039;&#039;&#039;2013&#039;&#039;&#039;, &#039;&#039;page=524&#039;&#039;&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Heat can be calculated from equation &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is: &amp;lt;math&amp;gt;C_V = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; is in reduced unit.&lt;br /&gt;
&lt;br /&gt;
Thus: &amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{N^2}{V}\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2} = (density)N\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected from the equaiton above, heat capacity per volume is proportional to the density and inversely proportional to the square of temperature, and it is also the trend that is obtained from Figure.12.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550733</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550733"/>
		<updated>2016-03-08T14:45:06Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Calculating Heat Capacities Using Statistical Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550727</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550727"/>
		<updated>2016-03-08T14:40:44Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Calculating Heat Capacities Using Statistical Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550726</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550726"/>
		<updated>2016-03-08T14:39:38Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 18_Plotting the Equations of State */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550725</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550725"/>
		<updated>2016-03-08T14:37:00Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 18_Plotting the Equations of State */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|Figure.11 The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550503</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550503"/>
		<updated>2016-03-07T22:47:48Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 19_Heat Capacity Calculation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0.8   T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc 0.8&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.2&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
 ### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
&lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
&lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
 run 10000&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable etotal equal etotal&lt;br /&gt;
 variable etotal2 equal etotal*etotal&lt;br /&gt;
 variable vol equal vol&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
 run 100000&lt;br /&gt;
&lt;br /&gt;
 variable avetemp equal f_aves[1]&lt;br /&gt;
 variable aveeng equal f_aves[3]&lt;br /&gt;
 variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
 variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
 print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550433</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550433"/>
		<updated>2016-03-07T18:08:54Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Calculating Heat Capacities Using Statistical Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0 8 T^* = 2.2&amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.8&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.2&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable aveeng equal f_aves[3]&lt;br /&gt;
variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550432</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550432"/>
		<updated>2016-03-07T18:06:36Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 19_Heat Capacity Calculation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0 8 T^* = 2.2&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.8&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.2&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable aveeng equal f_aves[3]&lt;br /&gt;
variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot; &amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550430</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=550430"/>
		<updated>2016-03-07T17:58:59Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 18_Plotting the Equations of State */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
===TASK 19_Heat Capacity Calculation===&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The script attached below is the my input file for &amp;lt;math&amp;gt;\rho^* =0 8 T^* = 2.2&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.8&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.2&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
thermo_style custom step etotal temp press density vol atoms&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_etotal v_etotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable aveeng equal f_aves[3]&lt;br /&gt;
variable heatcap equal atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2])&lt;br /&gt;
variable heatcapvol equal ((atoms*atoms*((f_aves[4]-(f_aves[3]*f_aves[3]))/f_aves[2]))/vol)&lt;br /&gt;
&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Etotal: ${aveeng}&amp;quot;&lt;br /&gt;
print &amp;quot;HeatCapacity: ${heatcap}&amp;quot;&lt;br /&gt;
print &amp;quot;HeatCapacityPerVol: ${heatcapvol}&amp;quot;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549910</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549910"/>
		<updated>2016-03-07T15:23:34Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* REFERENCE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549877</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549877"/>
		<updated>2016-03-07T15:17:01Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 18_Plotting the Equations of State */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ideal gas obeys the equaiton of &amp;lt;math&amp;gt;PV =nRT&amp;lt;/math&amp;gt;   (3)&lt;br /&gt;
&lt;br /&gt;
Since  &amp;lt;math&amp;gt;n=\frac{N}{N_a}&amp;lt;/math&amp;gt; (4) ; &amp;lt;math&amp;gt;R=N_a K_b&amp;lt;/math&amp;gt; (5), where &amp;lt;math&amp;gt;K_b=1&amp;lt;/math&amp;gt; in reduced unit&lt;br /&gt;
&lt;br /&gt;
Substituting (4) and (5) into (3), we get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt; (6)&lt;br /&gt;
&lt;br /&gt;
Rearrange (6)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density = \left(\frac{N}{V}\right)= \frac{P}{K_b T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs temperature ideal.png|700px|left|thumb|The comparison between the densities of ideal gas and simulated gas as a function on temperature under P=2.6 and P=2.7.]]&lt;br /&gt;
&lt;br /&gt;
= REFERENCE =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549791</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549791"/>
		<updated>2016-03-07T14:49:14Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 17_Examining the Input Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100:Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000:Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000:Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps. Fore examole, the values are taken on timesteps 100, 200,...100000, which will be used to compute the final average on every 100000 timestep. In other words, 1000 samples are obtained to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the ideal gas equation: &lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = \left(\frac{N}{V}\right) k_B T&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; when reduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Density = \left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = \left(Density\right) k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= REFERENCE =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549784</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549784"/>
		<updated>2016-03-07T14:46:43Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 18_Plotting the Equations of State */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100 -&amp;gt; Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000 -&amp;gt; Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000 -&amp;gt; Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps (i.e. on timesteps 100, 200,...100000), which will be used to compute the final average on every 100000 timestep. In other words we will have 1000 samples to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the ideal gas equation: &lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = \left(\frac{N}{V}\right) k_B T&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; when reduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Density = \left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = \left(Density\right) k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= REFERENCE =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549778</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549778"/>
		<updated>2016-03-07T14:44:08Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Checking equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100 -&amp;gt; Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000 -&amp;gt; Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000 -&amp;gt; Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps (i.e. on timesteps 100, 200,...100000), which will be used to compute the final average on every 100000 timestep. In other words we will have 1000 samples to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;br /&gt;
&lt;br /&gt;
====TASK 18_Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the ideal gas equation: &lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = \left(\frac{N}{V}\right) k_B T&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; when reduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Density = \left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = \left(Density\right) k_B T&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549752</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549752"/>
		<updated>2016-03-07T14:36:17Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Checking equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*According to Figure.10, the higher the pressure, the higher the density, as higher pressure lead to a smaller volume. The is due to density equals to &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;, smaller the volume resulting in greater density.&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature 1.png|700px|left|thumb|Fig.10 Density as a function of temperature for P=2.6 and P=2.7]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure. 11 indicates the comparison between simulated density and the predicted density from Ideal gas law. Figure. 10 also shows the trend of higher the pressure the higher the density and the simulated densities are smaller than the predicted values from ideal gas law. These observation can be explained as there is no interaction exist in ideal gas model; however, in real gas, interaction such as repulsion and attraction exits, meaning that the molecules cannot approach closely to each other. Thermodynamically, for ideal gas, pressure can be expressed in terms of entropy.&amp;lt;ref name=&amp;quot;Schroeder&amp;quot;&amp;gt;D. V. Schroeder, &amp;quot;An Introduction to Thermal Physics&amp;quot;, &#039;&#039;Addison Wesley&#039;&#039;, &#039;&#039;&#039;2000&#039;&#039;&#039;, &#039;&#039;CH 3&#039;&#039;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = T\left(\frac{\delta S}{\delta V}\right)_{U,N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the ideal gas equation: &lt;br /&gt;
&amp;lt;math&amp;gt;PV = N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = \left(\frac{N}{V}\right) k_B T&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; when reduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;Density = \left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = \left(Density\right) k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100 -&amp;gt; Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000 -&amp;gt; Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000 -&amp;gt; Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps (i.e. on timesteps 100, 200,...100000), which will be used to compute the final average on every 100000 timestep. In other words we will have 1000 samples to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549646</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549646"/>
		<updated>2016-03-07T11:41:12Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 14 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it has the same trend as 0.001, showing that it sufficient accuracy but not as short as 0.001, so we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100 -&amp;gt; Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000 -&amp;gt; Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000 -&amp;gt; Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps (i.e. on timesteps 100, 200,...100000), which will be used to compute the final average on every 100000 timestep. In other words we will have 1000 samples to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549645</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=549645"/>
		<updated>2016-03-07T11:38:03Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 11 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The cutoff means the the bond length where the Lennard-Jones potential is nearly zero. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it gives the same trend and fluctuation as with 0.001, meaning that it is accurate enough but not as short as 0.001, and we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100 -&amp;gt; Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000 -&amp;gt; Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000 -&amp;gt; Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps (i.e. on timesteps 100, 200,...100000), which will be used to compute the final average on every 100000 timestep. In other words we will have 1000 samples to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=548901</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=548901"/>
		<updated>2016-03-04T15:09:03Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 16_Examining the Input Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The curoff means the the bond distance where the Lennard-Jones potential almost reaches zero. In order to save time the simulation stops after the cutoff.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it gives the same trend and fluctuation as with 0.001, meaning that it is accurate enough but not as short as 0.001, and we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Temperature and Pressure Control====&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature ,T* = 1.5), 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 — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p, T) points. You should be able to use the results of the previous section to choose a timestep.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The chosen conditions are shown below:&lt;br /&gt;
&lt;br /&gt;
*Pressure: 2.6, 2.7 (selected values are base on previous section) &lt;br /&gt;
&lt;br /&gt;
*Temperature: 1.6, 1.8, 2.0, 2.2, 2.4&lt;br /&gt;
&lt;br /&gt;
*Timestep: 0.0025 (selected timestep are base on previous section)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 17_Examining the Input Script====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*100 -&amp;gt; Nevery (use input values every 100 timesteps)&lt;br /&gt;
&lt;br /&gt;
*1000 -&amp;gt; Nrepeat (use input values for calculating averages for 1000 times)&lt;br /&gt;
&lt;br /&gt;
*100000 -&amp;gt; Nfreq (calculate averages every 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
In this case, Nevery=100, Nrepeat=1000, and Nfreq=100000. The values are taken every 100 timesteps (i.e. on timesteps 100, 200,...100000), which will be used to compute the final average on every 100000 timestep. In other words we will have 1000 samples to calculate the average. The next line states &#039;run 100000&#039;, which means the simulation will run 100000 timesteps.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=548579</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=548579"/>
		<updated>2016-03-04T14:05:31Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 15 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The curoff means the the bond distance where the Lennard-Jones potential almost reaches zero. In order to save time the simulation stops after the cutoff.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it gives the same trend and fluctuation as with 0.001, meaning that it is accurate enough but not as short as 0.001, and we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15_Thermostats and Barostats====&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;  (1)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \left(\frac{1}{2}\sum_i m_i v_i^2\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;  (2)&lt;br /&gt;
&lt;br /&gt;
Substituted (1) into (2): &amp;lt;math&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;
We get: &amp;lt;math&amp;gt;\gamma^2 \left(\frac{3}{2} N k_B T\right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 16_Examining the Input Script====&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=548440</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=548440"/>
		<updated>2016-03-04T12:56:20Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The curoff means the the bond distance where the Lennard-Jones potential almost reaches zero. In order to save time the simulation stops after the cutoff.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it gives the same trend and fluctuation as with 0.001, meaning that it is accurate enough but not as short as 0.001, and we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
====TASK 15====&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=548248</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=548248"/>
		<updated>2016-03-03T17:39:27Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 14 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The curoff means the the bond distance where the Lennard-Jones potential almost reaches zero. In order to save time the simulation stops after the cutoff.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; *Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it gives the same trend and fluctuation as with 0.001, meaning that it is accurate enough but not as short as 0.001, and we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=548233</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=548233"/>
		<updated>2016-03-03T17:34:51Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
====TASK 8====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 we give atoms random starting coordinates, it may be a chance that the atoms don&#039;t move, and stay at the same position; or atoms are close together, which is unlikely to happen. If two atoms happen to be generated close together, there will be a strong repulsion between two atoms.&lt;br /&gt;
&lt;br /&gt;
====TASK 9====&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. 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;
In a &#039;&#039;&#039;simple cubic lattice&#039;&#039;&#039;, there is 1 atom in the unit cell, while lattice spacing in x,y,z = 1.07722 1.07722 1.07722.&lt;br /&gt;
The volume of unit cell=&amp;lt;math&amp;gt;1.07722^3=1.25000&amp;lt;/math&amp;gt;   &lt;br /&gt;
The number density of unit cell=&amp;lt;math&amp;gt;\frac{1}{1.25000} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a &#039;&#039;&#039;face-centered cubic lattice&#039;&#039;&#039;, there are 4 atoms in a unit cell, and the number density is 1.2.&lt;br /&gt;
&lt;br /&gt;
Assuming lattice spacing is x&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{4}{x^{3}} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 10====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
For a box containing 1000 unit cells, and 4 atoms in each unit cell, there will be 4000 atoms creat by the command.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
====TASK 11====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
*&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
mass 1 1.0 correspond to syntax of mass I value, where &#039;&#039;I&#039;&#039; represents the atom type, and &#039;&#039;value&#039;&#039; is the mass. &lt;br /&gt;
In this case means 1 type of atom with mass equals to 1.&lt;br /&gt;
The mass command aims to set the mass for all atoms of one or more atom types.&lt;br /&gt;
The mass command can only be used if the atom style requires per-type atom mass to be set.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time.&lt;br /&gt;
&lt;br /&gt;
A command sets the &#039;pair style&#039; to lj/&#039;cut style, which is the standard 12/6 Lennard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;r &amp;lt; r_{c}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{c}&amp;lt;/math&amp;gt; is the cutoff for Lennard Jones interaction. &lt;br /&gt;
In this case &amp;lt;math&amp;gt;r_{c} = 3.0&amp;lt;/math&amp;gt;. The curoff means the the bond distance where the Lennard-Jones potential almost reaches zero. In order to save time the simulation stops after the cutoff.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
Specify the pairwise force field coefficients for one or more pairs of atom types. The number and meaning of the coefficients depends on the pair style. &lt;br /&gt;
&lt;br /&gt;
For all of the lj/cut pair styles, pair_coeff command must be used to define coefficients for each pair of atoms types.&lt;br /&gt;
&lt;br /&gt;
A wildcard asterisk (* *) is used to set the coefficients for all pairs of atom types, then followed by the values indicating the coefficients for the pairs of atom types. The coefficients indicate epsilon and sigma in the Lennard-Jones respectively, in this case are (1.0 1.0).&lt;br /&gt;
&lt;br /&gt;
====TASK 12====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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. &lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
====TASK 13====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
The previous version is more convenient as timestep is the only variable that we need to type; all other variables are dependent on the timestep. While for the later one, all various is independent on the timestep, thus we need to change every line to base on what early one does.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
====TASK 14====&lt;br /&gt;
&#039;&#039;&#039; Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Plots of the energy (Figure 6), temperature (Figure 7), and pressure (Figure 8), against time for the 0.001 timestep experiment.&lt;br /&gt;
As can be seen from the graph below, the simulation reaches equilibrium after 0.3. The physical properties become stable after 0.3. &lt;br /&gt;
&lt;br /&gt;
[[File:Total energy vs time.png|700px|left|thumb|Figure.6 Total energy vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Temp vs time.png|700px|left|thumb|Figure.7 Temperature vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Press vs time.png|700px|left|thumb|Figure.8 Pressure vs time (timesteps=0.001)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make a single plot which shows the energy versus time for all of the timesteps.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
[[File:AllE vs time.png|700px|left|thumb|Figure.9  Energy VS Time under different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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 particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to Fig.9, the largest acceptable timestep is 0.0025, as it gives the same trend and fluctuation as with 0.001, meaning that it is accurate enough but not as short as 0.001, and we have longer time for simulation. 0.015 is a particularly bad choice for timestep because the total energy is not constant.&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=546362</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=546362"/>
		<updated>2016-03-02T11:47:04Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* TASK 7_Reduced Units */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2 \times 0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38\times 10^{-23} J/K \times 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656\times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16\times 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=546301</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=546301"/>
		<updated>2016-03-01T23:38:31Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 6_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position (0.5, 0.5, 0.5) in a cubic simulation box which runs from (0, 0, 0) to (1, 1, 1). In a single timestep, it moves along the vector (0.7, 0.6, 0.2). At what point does it end up, after the periodic boundary conditions have been applied?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Originally, the atom was at position (0.5, 0.5, 0.5), then it moved along the vector(0.7, 0.6, 0.2), the subsequent new position was (1.2, 1.1, 0.7). The central box was repeated infinitely in all directions, and when an atom crosses the boundary of the box, one of its replicas enters the box through the opposite face. Therefore, the resultant position should be (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
====TASK 7_Reduced Units====&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Distance &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \sigma&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.2&amp;lt;/math&amp;gt; * &amp;lt;math&amp;gt;0.34\mathrm{nm}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B * 120 K&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.38 * 10^{-23} J/K * 120 K &amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;1.656 * 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\left(0.34\mathrm{nm}\right)^{12}}{\left(1.088 nm\right)^{12}} - \frac{\left(0.34\mathrm{nm}\right)^6}{\left(1.088 nm\right)^6} \right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;6.16 * 10^{-24} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Temperature T = &amp;lt;math&amp;gt;\epsilon T^{*} \ / \ k_B = 180 K&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=546290</id>
		<title>Rep:Mod:NTH0510</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:NTH0510&amp;diff=546290"/>
		<updated>2016-03-01T20:33:44Z</updated>

		<summary type="html">&lt;p&gt;Dl912: /* Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====TASK 1====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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 t, &amp;quot;ERROR&amp;quot; should contain the absolute 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 A, &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;ANALYTICAL&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (Figure 1)&lt;br /&gt;
&lt;br /&gt;
[[File:ANALYTICAL 4.png|700px|left|thumb|Figure.1 Analytical Positions VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ERROR&#039;&#039;&#039; was calculated by the equation of &amp;lt;math&amp;gt;|ANALYTICAL-x\left(t\right)|&amp;lt;/math&amp;gt; (Figure 2)&lt;br /&gt;
&lt;br /&gt;
[[File:Error 4.png|700px|left|thumb|Figure.2 Error VS Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ENERGY&#039;&#039;&#039; &lt;br /&gt;
Total energy= Potential Energy+ Kinetic energy (Figure 3)&lt;br /&gt;
&lt;br /&gt;
For harmonic oscillation, potential energy obeys the Hooke’s law, and &amp;lt;math&amp;gt;PE=\int-Kx dx=1/2Kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For kinetic energy, &amp;lt;math&amp;gt;KE=1/2mv^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EVST.png|700px|left|thumb|Figure.3 Energy VS Time]]                           &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 2====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima error were extracted from time ranges of 0-3.2, 3.2-6.3, 6.3-9.4, 9.4-14.2 respectively.&lt;br /&gt;
The plot of maxima error against time and the line of best fit are shown in Figure 4 below.&lt;br /&gt;
&lt;br /&gt;
[[File:MAXIMA VS TIME.png|700px|left|thumb|Figure.4 Maxima VS Time]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maxima&lt;br /&gt;
! Time&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|0.000758457&lt;br /&gt;
|-&lt;br /&gt;
|4.9	&lt;br /&gt;
|0.00200771&lt;br /&gt;
|-&lt;br /&gt;
|8	&lt;br /&gt;
|0.00330076&lt;br /&gt;
|-&lt;br /&gt;
|11.1	&lt;br /&gt;
|0.004603854&lt;br /&gt;
|-&lt;br /&gt;
|14.2	&lt;br /&gt;
|0.005910508&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TASK 3====&lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
Nomally, the totally energy of the system is constant during harmonic oscillation. The fluctuation of the energy was due to the algorithm we used was not perfect. In order to minimise the change of energy is less than 1%, we need to change the timestep.&lt;br /&gt;
As can be seen from Figure 5, when timestep equalled 0.06 or less, the energy difference was less than 1%. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EVSTS.png|700px|left|thumb|Figure.5 Total Energy VS Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====TASK 4====&lt;br /&gt;
*&#039;&#039;&#039;TASK: 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;
The separation at which the potential energy is zero,implying the at that point, the single Lennard-Jones interaction needs to be zero. &lt;br /&gt;
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;&lt;br /&gt;
&lt;br /&gt;
Potential energy is zero, when &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-4\epsilon \left( -12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;-24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt; into the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;24\frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Find the equilibrium separation.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When atoms are in equilibrium state, the potential energy is at minimum. &lt;br /&gt;
In order to find the minimum potential energy, we need to differentiate the Lennard-Jones potential energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 0&amp;lt;/math&amp;gt; ; &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}} = 24\epsilon \left( 2\frac{\sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \left( \frac{\sigma}{\ r} \right)^{6}= 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;*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;math&amp;gt;\phi\left(r\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= r_{eq} = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{\left(2^{\frac{1}{6}}\sigma\right)^{12}} - \frac{\sigma^6}{\left(2^{\frac{1}{6}}\sigma\right)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = \epsilon -2\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;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;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = \int_{a\sigma}^{b} 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;, where a and b are boundary constant and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{a\sigma}^{b} \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( \frac{1}{b^{11}} - \frac{1}{a^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( \frac{1}{b^{5}} - \frac{1}{a^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2^{5}} \right) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 2.5&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{2.5^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{2.5^{5}} \right) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;When &amp;lt;math&amp;gt;a = 3&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b = \infty&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = - \frac{4 \epsilon \sigma}{11}\left( 0 - \frac{1}{3^{11}} \right) + \frac{4 \epsilon \sigma}{5}\left( 0 - \frac{1}{3^{5}} \right) = -0.003290&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TASK 5_Periodic Boundary Conditions====&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*The density of water is 1g/ml, therefore, for 1ml of water, mass is 1g. According to &amp;lt;math&amp;gt;n=\frac{m}{M}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;M=18 g/mol &amp;lt;/math&amp;gt;, the number of mole for 1 ml of water is 0.056 mol. &lt;br /&gt;
The number of water molecules equal to moles time advogado number (&amp;lt;math&amp;gt;6.02\times 10^{23}&amp;lt;/math&amp;gt;), thus,the number of water molecules in 1ml of water is &amp;lt;math&amp;gt;3.371\times 10^{23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{3.34 * 10^{22}}{1 mL} = \frac{10000}{V_{10000}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V_{10000} = 2.994 * 10^{-19}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dl912</name></author>
	</entry>
</feed>